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