/
tx_manager_mock.go
66 lines (50 loc) · 1.58 KB
/
tx_manager_mock.go
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
// Code generated by mockery v2.40.1. DO NOT EDIT.
package pgx
import (
context "context"
mock "github.com/stretchr/testify/mock"
pgx "github.com/jackc/pgx/v4"
)
// TxManagerMock is an autogenerated mock type for the TxManager type
type TxManagerMock struct {
mock.Mock
}
// WithNestedTx provides a mock function with given fields: ctx, tFunc
func (_m *TxManagerMock) WithNestedTx(ctx context.Context, tFunc func(context.Context, pgx.Tx) error) error {
ret := _m.Called(ctx, tFunc)
if len(ret) == 0 {
panic("no return value specified for WithNestedTx")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, func(context.Context, pgx.Tx) error) error); ok {
r0 = rf(ctx, tFunc)
} else {
r0 = ret.Error(0)
}
return r0
}
// WithTx provides a mock function with given fields: ctx, fn
func (_m *TxManagerMock) WithTx(ctx context.Context, fn func(context.Context, pgx.Tx) error) error {
ret := _m.Called(ctx, fn)
if len(ret) == 0 {
panic("no return value specified for WithTx")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, func(context.Context, pgx.Tx) error) error); ok {
r0 = rf(ctx, fn)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewTxManagerMock creates a new instance of TxManagerMock. 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 NewTxManagerMock(t interface {
mock.TestingT
Cleanup(func())
}) *TxManagerMock {
mock := &TxManagerMock{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}