/
UseCase.go
176 lines (140 loc) · 4.78 KB
/
UseCase.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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// Code generated by mockery v2.40.1. DO NOT EDIT.
package mocks
import (
context "context"
syncintegration "github.com/azisuazusa/todo-cli/internal/domain/syncintegration"
mock "github.com/stretchr/testify/mock"
)
// UseCase is an autogenerated mock type for the UseCase type
type UseCase struct {
mock.Mock
}
type UseCase_Expecter struct {
mock *mock.Mock
}
func (_m *UseCase) EXPECT() *UseCase_Expecter {
return &UseCase_Expecter{mock: &_m.Mock}
}
// Download provides a mock function with given fields: ctx
func (_m *UseCase) Download(ctx context.Context) error {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for Download")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = rf(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// UseCase_Download_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Download'
type UseCase_Download_Call struct {
*mock.Call
}
// Download is a helper method to define mock.On call
// - ctx context.Context
func (_e *UseCase_Expecter) Download(ctx interface{}) *UseCase_Download_Call {
return &UseCase_Download_Call{Call: _e.mock.On("Download", ctx)}
}
func (_c *UseCase_Download_Call) Run(run func(ctx context.Context)) *UseCase_Download_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *UseCase_Download_Call) Return(_a0 error) *UseCase_Download_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *UseCase_Download_Call) RunAndReturn(run func(context.Context) error) *UseCase_Download_Call {
_c.Call.Return(run)
return _c
}
// SetSyncIntegration provides a mock function with given fields: ctx, integration
func (_m *UseCase) SetSyncIntegration(ctx context.Context, integration syncintegration.SyncIntegration) error {
ret := _m.Called(ctx, integration)
if len(ret) == 0 {
panic("no return value specified for SetSyncIntegration")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, syncintegration.SyncIntegration) error); ok {
r0 = rf(ctx, integration)
} else {
r0 = ret.Error(0)
}
return r0
}
// UseCase_SetSyncIntegration_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetSyncIntegration'
type UseCase_SetSyncIntegration_Call struct {
*mock.Call
}
// SetSyncIntegration is a helper method to define mock.On call
// - ctx context.Context
// - integration syncintegration.SyncIntegration
func (_e *UseCase_Expecter) SetSyncIntegration(ctx interface{}, integration interface{}) *UseCase_SetSyncIntegration_Call {
return &UseCase_SetSyncIntegration_Call{Call: _e.mock.On("SetSyncIntegration", ctx, integration)}
}
func (_c *UseCase_SetSyncIntegration_Call) Run(run func(ctx context.Context, integration syncintegration.SyncIntegration)) *UseCase_SetSyncIntegration_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(syncintegration.SyncIntegration))
})
return _c
}
func (_c *UseCase_SetSyncIntegration_Call) Return(_a0 error) *UseCase_SetSyncIntegration_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *UseCase_SetSyncIntegration_Call) RunAndReturn(run func(context.Context, syncintegration.SyncIntegration) error) *UseCase_SetSyncIntegration_Call {
_c.Call.Return(run)
return _c
}
// Upload provides a mock function with given fields: ctx
func (_m *UseCase) Upload(ctx context.Context) error {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for Upload")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = rf(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// UseCase_Upload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Upload'
type UseCase_Upload_Call struct {
*mock.Call
}
// Upload is a helper method to define mock.On call
// - ctx context.Context
func (_e *UseCase_Expecter) Upload(ctx interface{}) *UseCase_Upload_Call {
return &UseCase_Upload_Call{Call: _e.mock.On("Upload", ctx)}
}
func (_c *UseCase_Upload_Call) Run(run func(ctx context.Context)) *UseCase_Upload_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *UseCase_Upload_Call) Return(_a0 error) *UseCase_Upload_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *UseCase_Upload_Call) RunAndReturn(run func(context.Context) error) *UseCase_Upload_Call {
_c.Call.Return(run)
return _c
}
// NewUseCase creates a new instance of UseCase. 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 NewUseCase(t interface {
mock.TestingT
Cleanup(func())
}) *UseCase {
mock := &UseCase{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}