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