This repository was archived by the owner on Jan 21, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmock_Service_test.go
More file actions
83 lines (65 loc) · 2.15 KB
/
mock_Service_test.go
File metadata and controls
83 lines (65 loc) · 2.15 KB
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
// Code generated by mockery. DO NOT EDIT.
package gosync
import (
context "context"
mock "github.com/stretchr/testify/mock"
)
// MockService is an autogenerated mock type for the Service type
type MockService struct {
mock.Mock
}
type MockService_Expecter struct {
mock *mock.Mock
}
func (_m *MockService) EXPECT() *MockService_Expecter {
return &MockService_Expecter{mock: &_m.Mock}
}
// SyncWith provides a mock function with given fields: ctx, adapter
func (_m *MockService) SyncWith(ctx context.Context, adapter Adapter) error {
ret := _m.Called(ctx, adapter)
if len(ret) == 0 {
panic("no return value specified for SyncWith")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, Adapter) error); ok {
r0 = rf(ctx, adapter)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockService_SyncWith_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SyncWith'
type MockService_SyncWith_Call struct {
*mock.Call
}
// SyncWith is a helper method to define mock.On call
// - ctx context.Context
// - adapter Adapter
func (_e *MockService_Expecter) SyncWith(ctx interface{}, adapter interface{}) *MockService_SyncWith_Call {
return &MockService_SyncWith_Call{Call: _e.mock.On("SyncWith", ctx, adapter)}
}
func (_c *MockService_SyncWith_Call) Run(run func(ctx context.Context, adapter Adapter)) *MockService_SyncWith_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(Adapter))
})
return _c
}
func (_c *MockService_SyncWith_Call) Return(_a0 error) *MockService_SyncWith_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockService_SyncWith_Call) RunAndReturn(run func(context.Context, Adapter) error) *MockService_SyncWith_Call {
_c.Call.Return(run)
return _c
}
// NewMockService creates a new instance of MockService. 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 NewMockService(t interface {
mock.TestingT
Cleanup(func())
}) *MockService {
mock := &MockService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}