clock_mock.go RawHistoryFolder
1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package portsmocks
6
7import (
8 "time"
9
10 "github.com/bnema/vev/internal/ports"
11 mock "github.com/stretchr/testify/mock"
12)
13
14// NewMockClock creates a new instance of MockClock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
15// The first argument is typically a *testing.T value.
16func NewMockClock(t interface {
17 mock.TestingT
18 Cleanup(func())
19}) *MockClock {
20 if helper, ok := t.(interface{ Helper() }); ok {
21 helper.Helper()
22 }
23
24 mock := &MockClock{}
25 mock.Mock.Test(t)
26
27 t.Cleanup(func() {
28 if helper, ok := t.(interface{ Helper() }); ok {
29 helper.Helper()
30 }
31 mock.AssertExpectations(t)
32 })
33
34 return mock
35}
36
37// MockClock is an autogenerated mock type for the Clock type
38type MockClock struct {
39 mock.Mock
40}
41
42type MockClock_Expecter struct {
43 mock *mock.Mock
44}
45
46func (_m *MockClock) EXPECT() *MockClock_Expecter {
47 return &MockClock_Expecter{mock: &_m.Mock}
48}
49
50// NewTimer provides a mock function for the type MockClock
51func (_mock *MockClock) NewTimer(d time.Duration) ports.Timer {
52 ret := _mock.Called(d)
53
54 if len(ret) == 0 {
55 panic("no return value specified for NewTimer")
56 }
57
58 var r0 ports.Timer
59 if returnFunc, ok := ret.Get(0).(func(time.Duration) ports.Timer); ok {
60 r0 = returnFunc(d)
61 } else {
62 if ret.Get(0) != nil {
63 r0 = ret.Get(0).(ports.Timer)
64 }
65 }
66 return r0
67}
68
69// MockClock_NewTimer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewTimer'
70type MockClock_NewTimer_Call struct {
71 *mock.Call
72}
73
74// NewTimer is a helper method to define mock.On call
75// - d time.Duration
76func (_e *MockClock_Expecter) NewTimer(d any) *MockClock_NewTimer_Call {
77 return &MockClock_NewTimer_Call{Call: _e.mock.On("NewTimer", d)}
78}
79
80func (_c *MockClock_NewTimer_Call) Run(run func(d time.Duration)) *MockClock_NewTimer_Call {
81 _c.Call.Run(func(args mock.Arguments) {
82 var arg0 time.Duration
83 if args[0] != nil {
84 arg0 = args[0].(time.Duration)
85 }
86 run(
87 arg0,
88 )
89 })
90 return _c
91}
92
93func (_c *MockClock_NewTimer_Call) Return(timer ports.Timer) *MockClock_NewTimer_Call {
94 _c.Call.Return(timer)
95 return _c
96}
97
98func (_c *MockClock_NewTimer_Call) RunAndReturn(run func(d time.Duration) ports.Timer) *MockClock_NewTimer_Call {
99 _c.Call.Return(run)
100 return _c
101}
102
103// Now provides a mock function for the type MockClock
104func (_mock *MockClock) Now() time.Time {
105 ret := _mock.Called()
106
107 if len(ret) == 0 {
108 panic("no return value specified for Now")
109 }
110
111 var r0 time.Time
112 if returnFunc, ok := ret.Get(0).(func() time.Time); ok {
113 r0 = returnFunc()
114 } else {
115 r0 = ret.Get(0).(time.Time)
116 }
117 return r0
118}
119
120// MockClock_Now_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Now'
121type MockClock_Now_Call struct {
122 *mock.Call
123}
124
125// Now is a helper method to define mock.On call
126func (_e *MockClock_Expecter) Now() *MockClock_Now_Call {
127 return &MockClock_Now_Call{Call: _e.mock.On("Now")}
128}
129
130func (_c *MockClock_Now_Call) Run(run func()) *MockClock_Now_Call {
131 _c.Call.Run(func(args mock.Arguments) {
132 run()
133 })
134 return _c
135}
136
137func (_c *MockClock_Now_Call) Return(time1 time.Time) *MockClock_Now_Call {
138 _c.Call.Return(time1)
139 return _c
140}
141
142func (_c *MockClock_Now_Call) RunAndReturn(run func() time.Time) *MockClock_Now_Call {
143 _c.Call.Return(run)
144 return _c
145}
146
147// NewMockTimer creates a new instance of MockTimer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
148// The first argument is typically a *testing.T value.
149func NewMockTimer(t interface {
150 mock.TestingT
151 Cleanup(func())
152}) *MockTimer {
153 if helper, ok := t.(interface{ Helper() }); ok {
154 helper.Helper()
155 }
156
157 mock := &MockTimer{}
158 mock.Mock.Test(t)
159
160 t.Cleanup(func() {
161 if helper, ok := t.(interface{ Helper() }); ok {
162 helper.Helper()
163 }
164 mock.AssertExpectations(t)
165 })
166
167 return mock
168}
169
170// MockTimer is an autogenerated mock type for the Timer type
171type MockTimer struct {
172 mock.Mock
173}
174
175type MockTimer_Expecter struct {
176 mock *mock.Mock
177}
178
179func (_m *MockTimer) EXPECT() *MockTimer_Expecter {
180 return &MockTimer_Expecter{mock: &_m.Mock}
181}
182
183// C provides a mock function for the type MockTimer
184func (_mock *MockTimer) C() <-chan time.Time {
185 ret := _mock.Called()
186
187 if len(ret) == 0 {
188 panic("no return value specified for C")
189 }
190
191 var r0 <-chan time.Time
192 if returnFunc, ok := ret.Get(0).(func() <-chan time.Time); ok {
193 r0 = returnFunc()
194 } else {
195 if ret.Get(0) != nil {
196 r0 = ret.Get(0).(<-chan time.Time)
197 }
198 }
199 return r0
200}
201
202// MockTimer_C_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'C'
203type MockTimer_C_Call struct {
204 *mock.Call
205}
206
207// C is a helper method to define mock.On call
208func (_e *MockTimer_Expecter) C() *MockTimer_C_Call {
209 return &MockTimer_C_Call{Call: _e.mock.On("C")}
210}
211
212func (_c *MockTimer_C_Call) Run(run func()) *MockTimer_C_Call {
213 _c.Call.Run(func(args mock.Arguments) {
214 run()
215 })
216 return _c
217}
218
219func (_c *MockTimer_C_Call) Return(timeCh <-chan time.Time) *MockTimer_C_Call {
220 _c.Call.Return(timeCh)
221 return _c
222}
223
224func (_c *MockTimer_C_Call) RunAndReturn(run func() <-chan time.Time) *MockTimer_C_Call {
225 _c.Call.Return(run)
226 return _c
227}
228
229// Reset provides a mock function for the type MockTimer
230func (_mock *MockTimer) Reset(d time.Duration) bool {
231 ret := _mock.Called(d)
232
233 if len(ret) == 0 {
234 panic("no return value specified for Reset")
235 }
236
237 var r0 bool
238 if returnFunc, ok := ret.Get(0).(func(time.Duration) bool); ok {
239 r0 = returnFunc(d)
240 } else {
241 r0 = ret.Get(0).(bool)
242 }
243 return r0
244}
245
246// MockTimer_Reset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reset'
247type MockTimer_Reset_Call struct {
248 *mock.Call
249}
250
251// Reset is a helper method to define mock.On call
252// - d time.Duration
253func (_e *MockTimer_Expecter) Reset(d any) *MockTimer_Reset_Call {
254 return &MockTimer_Reset_Call{Call: _e.mock.On("Reset", d)}
255}
256
257func (_c *MockTimer_Reset_Call) Run(run func(d time.Duration)) *MockTimer_Reset_Call {
258 _c.Call.Run(func(args mock.Arguments) {
259 var arg0 time.Duration
260 if args[0] != nil {
261 arg0 = args[0].(time.Duration)
262 }
263 run(
264 arg0,
265 )
266 })
267 return _c
268}
269
270func (_c *MockTimer_Reset_Call) Return(b bool) *MockTimer_Reset_Call {
271 _c.Call.Return(b)
272 return _c
273}
274
275func (_c *MockTimer_Reset_Call) RunAndReturn(run func(d time.Duration) bool) *MockTimer_Reset_Call {
276 _c.Call.Return(run)
277 return _c
278}
279
280// Stop provides a mock function for the type MockTimer
281func (_mock *MockTimer) Stop() bool {
282 ret := _mock.Called()
283
284 if len(ret) == 0 {
285 panic("no return value specified for Stop")
286 }
287
288 var r0 bool
289 if returnFunc, ok := ret.Get(0).(func() bool); ok {
290 r0 = returnFunc()
291 } else {
292 r0 = ret.Get(0).(bool)
293 }
294 return r0
295}
296
297// MockTimer_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
298type MockTimer_Stop_Call struct {
299 *mock.Call
300}
301
302// Stop is a helper method to define mock.On call
303func (_e *MockTimer_Expecter) Stop() *MockTimer_Stop_Call {
304 return &MockTimer_Stop_Call{Call: _e.mock.On("Stop")}
305}
306
307func (_c *MockTimer_Stop_Call) Run(run func()) *MockTimer_Stop_Call {
308 _c.Call.Run(func(args mock.Arguments) {
309 run()
310 })
311 return _c
312}
313
314func (_c *MockTimer_Stop_Call) Return(b bool) *MockTimer_Stop_Call {
315 _c.Call.Return(b)
316 return _c
317}
318
319func (_c *MockTimer_Stop_Call) RunAndReturn(run func() bool) *MockTimer_Stop_Call {
320 _c.Call.Return(run)
321 return _c
322}