v0.31.0 d5e0505

IssueStore.go RawHistoryFolder

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

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 2

Tags 45

↑↓ moveenter openesc close