1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9 "time"
10
11 "bnema.dev/ermite/internal/domain"
12 "bnema.dev/ermite/internal/ports"
13 mock "github.com/stretchr/testify/mock"
14)
15
16// NewPendingIssueStore creates a new instance of PendingIssueStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
17// The first argument is typically a *testing.T value.
18func NewPendingIssueStore(t interface {
19 mock.TestingT
20 Cleanup(func())
21}) *PendingIssueStore {
22 if helper, ok := t.(interface{ Helper() }); ok {
23 helper.Helper()
24 }
25
26 mock := &PendingIssueStore{}
27 mock.Mock.Test(t)
28
29 t.Cleanup(func() {
30 if helper, ok := t.(interface{ Helper() }); ok {
31 helper.Helper()
32 }
33 mock.AssertExpectations(t)
34 })
35
36 return mock
37}
38
39// PendingIssueStore is an autogenerated mock type for the PendingIssueStore type
40type PendingIssueStore struct {
41 mock.Mock
42}
43
44type PendingIssueStore_Expecter struct {
45 mock *mock.Mock
46}
47
48func (_m *PendingIssueStore) EXPECT() *PendingIssueStore_Expecter {
49 return &PendingIssueStore_Expecter{mock: &_m.Mock}
50}
51
52// Approve provides a mock function for the type PendingIssueStore
53func (_mock *PendingIssueStore) Approve(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID, now time.Time) (domain.Issue, error) {
54 ret := _mock.Called(ctx, repo, id, now)
55
56 if len(ret) == 0 {
57 panic("no return value specified for Approve")
58 }
59
60 var r0 domain.Issue
61 var r1 error
62 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.PendingIssueID, time.Time) (domain.Issue, error)); ok {
63 return returnFunc(ctx, repo, id, now)
64 }
65 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.PendingIssueID, time.Time) domain.Issue); ok {
66 r0 = returnFunc(ctx, repo, id, now)
67 } else {
68 r0 = ret.Get(0).(domain.Issue)
69 }
70 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.PendingIssueID, time.Time) error); ok {
71 r1 = returnFunc(ctx, repo, id, now)
72 } else {
73 r1 = ret.Error(1)
74 }
75 return r0, r1
76}
77
78// PendingIssueStore_Approve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Approve'
79type PendingIssueStore_Approve_Call struct {
80 *mock.Call
81}
82
83// Approve is a helper method to define mock.On call
84// - ctx context.Context
85// - repo domain.RepoName
86// - id domain.PendingIssueID
87// - now time.Time
88func (_e *PendingIssueStore_Expecter) Approve(ctx any, repo any, id any, now any) *PendingIssueStore_Approve_Call {
89 return &PendingIssueStore_Approve_Call{Call: _e.mock.On("Approve", ctx, repo, id, now)}
90}
91
92func (_c *PendingIssueStore_Approve_Call) Run(run func(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID, now time.Time)) *PendingIssueStore_Approve_Call {
93 _c.Call.Run(func(args mock.Arguments) {
94 var arg0 context.Context
95 if args[0] != nil {
96 arg0 = args[0].(context.Context)
97 }
98 var arg1 domain.RepoName
99 if args[1] != nil {
100 arg1 = args[1].(domain.RepoName)
101 }
102 var arg2 domain.PendingIssueID
103 if args[2] != nil {
104 arg2 = args[2].(domain.PendingIssueID)
105 }
106 var arg3 time.Time
107 if args[3] != nil {
108 arg3 = args[3].(time.Time)
109 }
110 run(
111 arg0,
112 arg1,
113 arg2,
114 arg3,
115 )
116 })
117 return _c
118}
119
120func (_c *PendingIssueStore_Approve_Call) Return(issue domain.Issue, err error) *PendingIssueStore_Approve_Call {
121 _c.Call.Return(issue, err)
122 return _c
123}
124
125func (_c *PendingIssueStore_Approve_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID, now time.Time) (domain.Issue, error)) *PendingIssueStore_Approve_Call {
126 _c.Call.Return(run)
127 return _c
128}
129
130// Count provides a mock function for the type PendingIssueStore
131func (_mock *PendingIssueStore) Count(ctx context.Context) (int, error) {
132 ret := _mock.Called(ctx)
133
134 if len(ret) == 0 {
135 panic("no return value specified for Count")
136 }
137
138 var r0 int
139 var r1 error
140 if returnFunc, ok := ret.Get(0).(func(context.Context) (int, error)); ok {
141 return returnFunc(ctx)
142 }
143 if returnFunc, ok := ret.Get(0).(func(context.Context) int); ok {
144 r0 = returnFunc(ctx)
145 } else {
146 r0 = ret.Get(0).(int)
147 }
148 if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
149 r1 = returnFunc(ctx)
150 } else {
151 r1 = ret.Error(1)
152 }
153 return r0, r1
154}
155
156// PendingIssueStore_Count_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Count'
157type PendingIssueStore_Count_Call struct {
158 *mock.Call
159}
160
161// Count is a helper method to define mock.On call
162// - ctx context.Context
163func (_e *PendingIssueStore_Expecter) Count(ctx any) *PendingIssueStore_Count_Call {
164 return &PendingIssueStore_Count_Call{Call: _e.mock.On("Count", ctx)}
165}
166
167func (_c *PendingIssueStore_Count_Call) Run(run func(ctx context.Context)) *PendingIssueStore_Count_Call {
168 _c.Call.Run(func(args mock.Arguments) {
169 var arg0 context.Context
170 if args[0] != nil {
171 arg0 = args[0].(context.Context)
172 }
173 run(
174 arg0,
175 )
176 })
177 return _c
178}
179
180func (_c *PendingIssueStore_Count_Call) Return(n int, err error) *PendingIssueStore_Count_Call {
181 _c.Call.Return(n, err)
182 return _c
183}
184
185func (_c *PendingIssueStore_Count_Call) RunAndReturn(run func(ctx context.Context) (int, error)) *PendingIssueStore_Count_Call {
186 _c.Call.Return(run)
187 return _c
188}
189
190// Delete provides a mock function for the type PendingIssueStore
191func (_mock *PendingIssueStore) Delete(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID) error {
192 ret := _mock.Called(ctx, repo, id)
193
194 if len(ret) == 0 {
195 panic("no return value specified for Delete")
196 }
197
198 var r0 error
199 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.PendingIssueID) error); ok {
200 r0 = returnFunc(ctx, repo, id)
201 } else {
202 r0 = ret.Error(0)
203 }
204 return r0
205}
206
207// PendingIssueStore_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
208type PendingIssueStore_Delete_Call struct {
209 *mock.Call
210}
211
212// Delete is a helper method to define mock.On call
213// - ctx context.Context
214// - repo domain.RepoName
215// - id domain.PendingIssueID
216func (_e *PendingIssueStore_Expecter) Delete(ctx any, repo any, id any) *PendingIssueStore_Delete_Call {
217 return &PendingIssueStore_Delete_Call{Call: _e.mock.On("Delete", ctx, repo, id)}
218}
219
220func (_c *PendingIssueStore_Delete_Call) Run(run func(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID)) *PendingIssueStore_Delete_Call {
221 _c.Call.Run(func(args mock.Arguments) {
222 var arg0 context.Context
223 if args[0] != nil {
224 arg0 = args[0].(context.Context)
225 }
226 var arg1 domain.RepoName
227 if args[1] != nil {
228 arg1 = args[1].(domain.RepoName)
229 }
230 var arg2 domain.PendingIssueID
231 if args[2] != nil {
232 arg2 = args[2].(domain.PendingIssueID)
233 }
234 run(
235 arg0,
236 arg1,
237 arg2,
238 )
239 })
240 return _c
241}
242
243func (_c *PendingIssueStore_Delete_Call) Return(err error) *PendingIssueStore_Delete_Call {
244 _c.Call.Return(err)
245 return _c
246}
247
248func (_c *PendingIssueStore_Delete_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID) error) *PendingIssueStore_Delete_Call {
249 _c.Call.Return(run)
250 return _c
251}
252
253// Get provides a mock function for the type PendingIssueStore
254func (_mock *PendingIssueStore) Get(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID) (domain.PendingIssue, error) {
255 ret := _mock.Called(ctx, repo, id)
256
257 if len(ret) == 0 {
258 panic("no return value specified for Get")
259 }
260
261 var r0 domain.PendingIssue
262 var r1 error
263 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.PendingIssueID) (domain.PendingIssue, error)); ok {
264 return returnFunc(ctx, repo, id)
265 }
266 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, domain.PendingIssueID) domain.PendingIssue); ok {
267 r0 = returnFunc(ctx, repo, id)
268 } else {
269 r0 = ret.Get(0).(domain.PendingIssue)
270 }
271 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, domain.PendingIssueID) error); ok {
272 r1 = returnFunc(ctx, repo, id)
273 } else {
274 r1 = ret.Error(1)
275 }
276 return r0, r1
277}
278
279// PendingIssueStore_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
280type PendingIssueStore_Get_Call struct {
281 *mock.Call
282}
283
284// Get is a helper method to define mock.On call
285// - ctx context.Context
286// - repo domain.RepoName
287// - id domain.PendingIssueID
288func (_e *PendingIssueStore_Expecter) Get(ctx any, repo any, id any) *PendingIssueStore_Get_Call {
289 return &PendingIssueStore_Get_Call{Call: _e.mock.On("Get", ctx, repo, id)}
290}
291
292func (_c *PendingIssueStore_Get_Call) Run(run func(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID)) *PendingIssueStore_Get_Call {
293 _c.Call.Run(func(args mock.Arguments) {
294 var arg0 context.Context
295 if args[0] != nil {
296 arg0 = args[0].(context.Context)
297 }
298 var arg1 domain.RepoName
299 if args[1] != nil {
300 arg1 = args[1].(domain.RepoName)
301 }
302 var arg2 domain.PendingIssueID
303 if args[2] != nil {
304 arg2 = args[2].(domain.PendingIssueID)
305 }
306 run(
307 arg0,
308 arg1,
309 arg2,
310 )
311 })
312 return _c
313}
314
315func (_c *PendingIssueStore_Get_Call) Return(pendingIssue domain.PendingIssue, err error) *PendingIssueStore_Get_Call {
316 _c.Call.Return(pendingIssue, err)
317 return _c
318}
319
320func (_c *PendingIssueStore_Get_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, id domain.PendingIssueID) (domain.PendingIssue, error)) *PendingIssueStore_Get_Call {
321 _c.Call.Return(run)
322 return _c
323}
324
325// List provides a mock function for the type PendingIssueStore
326func (_mock *PendingIssueStore) List(ctx context.Context, repo domain.RepoName, page ports.ListPendingParams) (ports.PendingIssuePage, error) {
327 ret := _mock.Called(ctx, repo, page)
328
329 if len(ret) == 0 {
330 panic("no return value specified for List")
331 }
332
333 var r0 ports.PendingIssuePage
334 var r1 error
335 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, ports.ListPendingParams) (ports.PendingIssuePage, error)); ok {
336 return returnFunc(ctx, repo, page)
337 }
338 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, ports.ListPendingParams) ports.PendingIssuePage); ok {
339 r0 = returnFunc(ctx, repo, page)
340 } else {
341 r0 = ret.Get(0).(ports.PendingIssuePage)
342 }
343 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, ports.ListPendingParams) error); ok {
344 r1 = returnFunc(ctx, repo, page)
345 } else {
346 r1 = ret.Error(1)
347 }
348 return r0, r1
349}
350
351// PendingIssueStore_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
352type PendingIssueStore_List_Call struct {
353 *mock.Call
354}
355
356// List is a helper method to define mock.On call
357// - ctx context.Context
358// - repo domain.RepoName
359// - page ports.ListPendingParams
360func (_e *PendingIssueStore_Expecter) List(ctx any, repo any, page any) *PendingIssueStore_List_Call {
361 return &PendingIssueStore_List_Call{Call: _e.mock.On("List", ctx, repo, page)}
362}
363
364func (_c *PendingIssueStore_List_Call) Run(run func(ctx context.Context, repo domain.RepoName, page ports.ListPendingParams)) *PendingIssueStore_List_Call {
365 _c.Call.Run(func(args mock.Arguments) {
366 var arg0 context.Context
367 if args[0] != nil {
368 arg0 = args[0].(context.Context)
369 }
370 var arg1 domain.RepoName
371 if args[1] != nil {
372 arg1 = args[1].(domain.RepoName)
373 }
374 var arg2 ports.ListPendingParams
375 if args[2] != nil {
376 arg2 = args[2].(ports.ListPendingParams)
377 }
378 run(
379 arg0,
380 arg1,
381 arg2,
382 )
383 })
384 return _c
385}
386
387func (_c *PendingIssueStore_List_Call) Return(pendingIssuePage ports.PendingIssuePage, err error) *PendingIssueStore_List_Call {
388 _c.Call.Return(pendingIssuePage, err)
389 return _c
390}
391
392func (_c *PendingIssueStore_List_Call) RunAndReturn(run func(ctx context.Context, repo domain.RepoName, page ports.ListPendingParams) (ports.PendingIssuePage, error)) *PendingIssueStore_List_Call {
393 _c.Call.Return(run)
394 return _c
395}
396
397// Put provides a mock function for the type PendingIssueStore
398func (_mock *PendingIssueStore) Put(ctx context.Context, p domain.PendingIssue) error {
399 ret := _mock.Called(ctx, p)
400
401 if len(ret) == 0 {
402 panic("no return value specified for Put")
403 }
404
405 var r0 error
406 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.PendingIssue) error); ok {
407 r0 = returnFunc(ctx, p)
408 } else {
409 r0 = ret.Error(0)
410 }
411 return r0
412}
413
414// PendingIssueStore_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put'
415type PendingIssueStore_Put_Call struct {
416 *mock.Call
417}
418
419// Put is a helper method to define mock.On call
420// - ctx context.Context
421// - p domain.PendingIssue
422func (_e *PendingIssueStore_Expecter) Put(ctx any, p any) *PendingIssueStore_Put_Call {
423 return &PendingIssueStore_Put_Call{Call: _e.mock.On("Put", ctx, p)}
424}
425
426func (_c *PendingIssueStore_Put_Call) Run(run func(ctx context.Context, p domain.PendingIssue)) *PendingIssueStore_Put_Call {
427 _c.Call.Run(func(args mock.Arguments) {
428 var arg0 context.Context
429 if args[0] != nil {
430 arg0 = args[0].(context.Context)
431 }
432 var arg1 domain.PendingIssue
433 if args[1] != nil {
434 arg1 = args[1].(domain.PendingIssue)
435 }
436 run(
437 arg0,
438 arg1,
439 )
440 })
441 return _c
442}
443
444func (_c *PendingIssueStore_Put_Call) Return(err error) *PendingIssueStore_Put_Call {
445 _c.Call.Return(err)
446 return _c
447}
448
449func (_c *PendingIssueStore_Put_Call) RunAndReturn(run func(ctx context.Context, p domain.PendingIssue) error) *PendingIssueStore_Put_Call {
450 _c.Call.Return(run)
451 return _c
452}