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 mock "github.com/stretchr/testify/mock"
12)
13
14// NewRepoMetaStore creates a new instance of RepoMetaStore. 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 NewRepoMetaStore(t interface {
17 mock.TestingT
18 Cleanup(func())
19}) *RepoMetaStore {
20 if helper, ok := t.(interface{ Helper() }); ok {
21 helper.Helper()
22 }
23
24 mock := &RepoMetaStore{}
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// RepoMetaStore is an autogenerated mock type for the RepoMetaStore type
38type RepoMetaStore struct {
39 mock.Mock
40}
41
42type RepoMetaStore_Expecter struct {
43 mock *mock.Mock
44}
45
46func (_m *RepoMetaStore) EXPECT() *RepoMetaStore_Expecter {
47 return &RepoMetaStore_Expecter{mock: &_m.Mock}
48}
49
50// Create provides a mock function for the type RepoMetaStore
51func (_mock *RepoMetaStore) Create(ctx context.Context, repo domain.Repo) error {
52 ret := _mock.Called(ctx, repo)
53
54 if len(ret) == 0 {
55 panic("no return value specified for Create")
56 }
57
58 var r0 error
59 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.Repo) error); ok {
60 r0 = returnFunc(ctx, repo)
61 } else {
62 r0 = ret.Error(0)
63 }
64 return r0
65}
66
67// RepoMetaStore_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
68type RepoMetaStore_Create_Call struct {
69 *mock.Call
70}
71
72// Create is a helper method to define mock.On call
73// - ctx context.Context
74// - repo domain.Repo
75func (_e *RepoMetaStore_Expecter) Create(ctx any, repo any) *RepoMetaStore_Create_Call {
76 return &RepoMetaStore_Create_Call{Call: _e.mock.On("Create", ctx, repo)}
77}
78
79func (_c *RepoMetaStore_Create_Call) Run(run func(ctx context.Context, repo domain.Repo)) *RepoMetaStore_Create_Call {
80 _c.Call.Run(func(args mock.Arguments) {
81 var arg0 context.Context
82 if args[0] != nil {
83 arg0 = args[0].(context.Context)
84 }
85 var arg1 domain.Repo
86 if args[1] != nil {
87 arg1 = args[1].(domain.Repo)
88 }
89 run(
90 arg0,
91 arg1,
92 )
93 })
94 return _c
95}
96
97func (_c *RepoMetaStore_Create_Call) Return(err error) *RepoMetaStore_Create_Call {
98 _c.Call.Return(err)
99 return _c
100}
101
102func (_c *RepoMetaStore_Create_Call) RunAndReturn(run func(ctx context.Context, repo domain.Repo) error) *RepoMetaStore_Create_Call {
103 _c.Call.Return(run)
104 return _c
105}
106
107// Delete provides a mock function for the type RepoMetaStore
108func (_mock *RepoMetaStore) Delete(ctx context.Context, name domain.RepoName) error {
109 ret := _mock.Called(ctx, name)
110
111 if len(ret) == 0 {
112 panic("no return value specified for Delete")
113 }
114
115 var r0 error
116 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) error); ok {
117 r0 = returnFunc(ctx, name)
118 } else {
119 r0 = ret.Error(0)
120 }
121 return r0
122}
123
124// RepoMetaStore_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
125type RepoMetaStore_Delete_Call struct {
126 *mock.Call
127}
128
129// Delete is a helper method to define mock.On call
130// - ctx context.Context
131// - name domain.RepoName
132func (_e *RepoMetaStore_Expecter) Delete(ctx any, name any) *RepoMetaStore_Delete_Call {
133 return &RepoMetaStore_Delete_Call{Call: _e.mock.On("Delete", ctx, name)}
134}
135
136func (_c *RepoMetaStore_Delete_Call) Run(run func(ctx context.Context, name domain.RepoName)) *RepoMetaStore_Delete_Call {
137 _c.Call.Run(func(args mock.Arguments) {
138 var arg0 context.Context
139 if args[0] != nil {
140 arg0 = args[0].(context.Context)
141 }
142 var arg1 domain.RepoName
143 if args[1] != nil {
144 arg1 = args[1].(domain.RepoName)
145 }
146 run(
147 arg0,
148 arg1,
149 )
150 })
151 return _c
152}
153
154func (_c *RepoMetaStore_Delete_Call) Return(err error) *RepoMetaStore_Delete_Call {
155 _c.Call.Return(err)
156 return _c
157}
158
159func (_c *RepoMetaStore_Delete_Call) RunAndReturn(run func(ctx context.Context, name domain.RepoName) error) *RepoMetaStore_Delete_Call {
160 _c.Call.Return(run)
161 return _c
162}
163
164// Get provides a mock function for the type RepoMetaStore
165func (_mock *RepoMetaStore) Get(ctx context.Context, name domain.RepoName) (domain.Repo, error) {
166 ret := _mock.Called(ctx, name)
167
168 if len(ret) == 0 {
169 panic("no return value specified for Get")
170 }
171
172 var r0 domain.Repo
173 var r1 error
174 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) (domain.Repo, error)); ok {
175 return returnFunc(ctx, name)
176 }
177 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName) domain.Repo); ok {
178 r0 = returnFunc(ctx, name)
179 } else {
180 r0 = ret.Get(0).(domain.Repo)
181 }
182 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName) error); ok {
183 r1 = returnFunc(ctx, name)
184 } else {
185 r1 = ret.Error(1)
186 }
187 return r0, r1
188}
189
190// RepoMetaStore_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
191type RepoMetaStore_Get_Call struct {
192 *mock.Call
193}
194
195// Get is a helper method to define mock.On call
196// - ctx context.Context
197// - name domain.RepoName
198func (_e *RepoMetaStore_Expecter) Get(ctx any, name any) *RepoMetaStore_Get_Call {
199 return &RepoMetaStore_Get_Call{Call: _e.mock.On("Get", ctx, name)}
200}
201
202func (_c *RepoMetaStore_Get_Call) Run(run func(ctx context.Context, name domain.RepoName)) *RepoMetaStore_Get_Call {
203 _c.Call.Run(func(args mock.Arguments) {
204 var arg0 context.Context
205 if args[0] != nil {
206 arg0 = args[0].(context.Context)
207 }
208 var arg1 domain.RepoName
209 if args[1] != nil {
210 arg1 = args[1].(domain.RepoName)
211 }
212 run(
213 arg0,
214 arg1,
215 )
216 })
217 return _c
218}
219
220func (_c *RepoMetaStore_Get_Call) Return(repo domain.Repo, err error) *RepoMetaStore_Get_Call {
221 _c.Call.Return(repo, err)
222 return _c
223}
224
225func (_c *RepoMetaStore_Get_Call) RunAndReturn(run func(ctx context.Context, name domain.RepoName) (domain.Repo, error)) *RepoMetaStore_Get_Call {
226 _c.Call.Return(run)
227 return _c
228}
229
230// List provides a mock function for the type RepoMetaStore
231func (_mock *RepoMetaStore) List(ctx context.Context) ([]domain.Repo, error) {
232 ret := _mock.Called(ctx)
233
234 if len(ret) == 0 {
235 panic("no return value specified for List")
236 }
237
238 var r0 []domain.Repo
239 var r1 error
240 if returnFunc, ok := ret.Get(0).(func(context.Context) ([]domain.Repo, error)); ok {
241 return returnFunc(ctx)
242 }
243 if returnFunc, ok := ret.Get(0).(func(context.Context) []domain.Repo); ok {
244 r0 = returnFunc(ctx)
245 } else {
246 if ret.Get(0) != nil {
247 r0 = ret.Get(0).([]domain.Repo)
248 }
249 }
250 if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
251 r1 = returnFunc(ctx)
252 } else {
253 r1 = ret.Error(1)
254 }
255 return r0, r1
256}
257
258// RepoMetaStore_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
259type RepoMetaStore_List_Call struct {
260 *mock.Call
261}
262
263// List is a helper method to define mock.On call
264// - ctx context.Context
265func (_e *RepoMetaStore_Expecter) List(ctx any) *RepoMetaStore_List_Call {
266 return &RepoMetaStore_List_Call{Call: _e.mock.On("List", ctx)}
267}
268
269func (_c *RepoMetaStore_List_Call) Run(run func(ctx context.Context)) *RepoMetaStore_List_Call {
270 _c.Call.Run(func(args mock.Arguments) {
271 var arg0 context.Context
272 if args[0] != nil {
273 arg0 = args[0].(context.Context)
274 }
275 run(
276 arg0,
277 )
278 })
279 return _c
280}
281
282func (_c *RepoMetaStore_List_Call) Return(repos []domain.Repo, err error) *RepoMetaStore_List_Call {
283 _c.Call.Return(repos, err)
284 return _c
285}
286
287func (_c *RepoMetaStore_List_Call) RunAndReturn(run func(ctx context.Context) ([]domain.Repo, error)) *RepoMetaStore_List_Call {
288 _c.Call.Return(run)
289 return _c
290}
291
292// Mutate provides a mock function for the type RepoMetaStore
293func (_mock *RepoMetaStore) Mutate(ctx context.Context, name domain.RepoName, fn func(*domain.Repo) (changed bool, err error)) (domain.Repo, error) {
294 ret := _mock.Called(ctx, name, fn)
295
296 if len(ret) == 0 {
297 panic("no return value specified for Mutate")
298 }
299
300 var r0 domain.Repo
301 var r1 error
302 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, func(*domain.Repo) (changed bool, err error)) (domain.Repo, error)); ok {
303 return returnFunc(ctx, name, fn)
304 }
305 if returnFunc, ok := ret.Get(0).(func(context.Context, domain.RepoName, func(*domain.Repo) (changed bool, err error)) domain.Repo); ok {
306 r0 = returnFunc(ctx, name, fn)
307 } else {
308 r0 = ret.Get(0).(domain.Repo)
309 }
310 if returnFunc, ok := ret.Get(1).(func(context.Context, domain.RepoName, func(*domain.Repo) (changed bool, err error)) error); ok {
311 r1 = returnFunc(ctx, name, fn)
312 } else {
313 r1 = ret.Error(1)
314 }
315 return r0, r1
316}
317
318// RepoMetaStore_Mutate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Mutate'
319type RepoMetaStore_Mutate_Call struct {
320 *mock.Call
321}
322
323// Mutate is a helper method to define mock.On call
324// - ctx context.Context
325// - name domain.RepoName
326// - fn func(*domain.Repo) (changed bool, err error)
327func (_e *RepoMetaStore_Expecter) Mutate(ctx any, name any, fn any) *RepoMetaStore_Mutate_Call {
328 return &RepoMetaStore_Mutate_Call{Call: _e.mock.On("Mutate", ctx, name, fn)}
329}
330
331func (_c *RepoMetaStore_Mutate_Call) Run(run func(ctx context.Context, name domain.RepoName, fn func(*domain.Repo) (changed bool, err error))) *RepoMetaStore_Mutate_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.RepoName
338 if args[1] != nil {
339 arg1 = args[1].(domain.RepoName)
340 }
341 var arg2 func(*domain.Repo) (changed bool, err error)
342 if args[2] != nil {
343 arg2 = args[2].(func(*domain.Repo) (changed bool, err error))
344 }
345 run(
346 arg0,
347 arg1,
348 arg2,
349 )
350 })
351 return _c
352}
353
354func (_c *RepoMetaStore_Mutate_Call) Return(repo domain.Repo, err error) *RepoMetaStore_Mutate_Call {
355 _c.Call.Return(repo, err)
356 return _c
357}
358
359func (_c *RepoMetaStore_Mutate_Call) RunAndReturn(run func(ctx context.Context, name domain.RepoName, fn func(*domain.Repo) (changed bool, err error)) (domain.Repo, error)) *RepoMetaStore_Mutate_Call {
360 _c.Call.Return(run)
361 return _c
362}