aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/coveragedb/mocks/ReadOnlyTransaction.go
blob: 3f00faca03f2c5fc927022970df60c5f80eaff99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify

package mocks

import (
	"context"

	"cloud.google.com/go/spanner"
	"github.com/google/syzkaller/pkg/coveragedb/spannerclient"
	mock "github.com/stretchr/testify/mock"
)

// NewReadOnlyTransaction creates a new instance of ReadOnlyTransaction. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewReadOnlyTransaction(t interface {
	mock.TestingT
	Cleanup(func())
}) *ReadOnlyTransaction {
	mock := &ReadOnlyTransaction{}
	mock.Mock.Test(t)

	t.Cleanup(func() { mock.AssertExpectations(t) })

	return mock
}

// ReadOnlyTransaction is an autogenerated mock type for the ReadOnlyTransaction type
type ReadOnlyTransaction struct {
	mock.Mock
}

type ReadOnlyTransaction_Expecter struct {
	mock *mock.Mock
}

func (_m *ReadOnlyTransaction) EXPECT() *ReadOnlyTransaction_Expecter {
	return &ReadOnlyTransaction_Expecter{mock: &_m.Mock}
}

// Query provides a mock function for the type ReadOnlyTransaction
func (_mock *ReadOnlyTransaction) Query(ctx context.Context, statement spanner.Statement) spannerclient.RowIterator {
	ret := _mock.Called(ctx, statement)

	if len(ret) == 0 {
		panic("no return value specified for Query")
	}

	var r0 spannerclient.RowIterator
	if returnFunc, ok := ret.Get(0).(func(context.Context, spanner.Statement) spannerclient.RowIterator); ok {
		r0 = returnFunc(ctx, statement)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(spannerclient.RowIterator)
		}
	}
	return r0
}

// ReadOnlyTransaction_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query'
type ReadOnlyTransaction_Query_Call struct {
	*mock.Call
}

// Query is a helper method to define mock.On call
//   - ctx context.Context
//   - statement spanner.Statement
func (_e *ReadOnlyTransaction_Expecter) Query(ctx interface{}, statement interface{}) *ReadOnlyTransaction_Query_Call {
	return &ReadOnlyTransaction_Query_Call{Call: _e.mock.On("Query", ctx, statement)}
}

func (_c *ReadOnlyTransaction_Query_Call) Run(run func(ctx context.Context, statement spanner.Statement)) *ReadOnlyTransaction_Query_Call {
	_c.Call.Run(func(args mock.Arguments) {
		var arg0 context.Context
		if args[0] != nil {
			arg0 = args[0].(context.Context)
		}
		var arg1 spanner.Statement
		if args[1] != nil {
			arg1 = args[1].(spanner.Statement)
		}
		run(
			arg0,
			arg1,
		)
	})
	return _c
}

func (_c *ReadOnlyTransaction_Query_Call) Return(rowIterator spannerclient.RowIterator) *ReadOnlyTransaction_Query_Call {
	_c.Call.Return(rowIterator)
	return _c
}

func (_c *ReadOnlyTransaction_Query_Call) RunAndReturn(run func(ctx context.Context, statement spanner.Statement) spannerclient.RowIterator) *ReadOnlyTransaction_Query_Call {
	_c.Call.Return(run)
	return _c
}