// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "time" "github.com/bnema/dumber/internal/domain/favicon" mock "github.com/stretchr/testify/mock" ) // 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. // The first argument is typically a *testing.T value. func NewMockFaviconRepository(t interface { mock.TestingT Cleanup(func()) }) *MockFaviconRepository { mock := &MockFaviconRepository{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockFaviconRepository is an autogenerated mock type for the FaviconRepository type type MockFaviconRepository struct { mock.Mock } type MockFaviconRepository_Expecter struct { mock *mock.Mock } func (_m *MockFaviconRepository) EXPECT() *MockFaviconRepository_Expecter { return &MockFaviconRepository_Expecter{mock: &_m.Mock} } // Delete provides a mock function for the type MockFaviconRepository func (_mock *MockFaviconRepository) Delete(ctx context.Context, key favicon.Key) error { ret := _mock.Called(ctx, key) if len(ret) == 0 { panic("no return value specified for Delete") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, favicon.Key) error); ok { r0 = returnFunc(ctx, key) } else { r0 = ret.Error(0) } return r0 } // MockFaviconRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' type MockFaviconRepository_Delete_Call struct { *mock.Call } // Delete is a helper method to define mock.On call // - ctx context.Context // - key favicon.Key func (_e *MockFaviconRepository_Expecter) Delete(ctx any, key any) *MockFaviconRepository_Delete_Call { return &MockFaviconRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, key)} } func (_c *MockFaviconRepository_Delete_Call) Run(run func(ctx context.Context, key favicon.Key)) *MockFaviconRepository_Delete_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 favicon.Key if args[1] != nil { arg1 = args[1].(favicon.Key) } run( arg0, arg1, ) }) return _c } func (_c *MockFaviconRepository_Delete_Call) Return(err error) *MockFaviconRepository_Delete_Call { _c.Call.Return(err) return _c } func (_c *MockFaviconRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, key favicon.Key) error) *MockFaviconRepository_Delete_Call { _c.Call.Return(run) return _c } // FindFirst provides a mock function for the type MockFaviconRepository func (_mock *MockFaviconRepository) FindFirst(ctx context.Context, keys []favicon.Key) (*favicon.Metadata, error) { ret := _mock.Called(ctx, keys) if len(ret) == 0 { panic("no return value specified for FindFirst") } var r0 *favicon.Metadata var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, []favicon.Key) (*favicon.Metadata, error)); ok { return returnFunc(ctx, keys) } if returnFunc, ok := ret.Get(0).(func(context.Context, []favicon.Key) *favicon.Metadata); ok { r0 = returnFunc(ctx, keys) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*favicon.Metadata) } } if returnFunc, ok := ret.Get(1).(func(context.Context, []favicon.Key) error); ok { r1 = returnFunc(ctx, keys) } else { r1 = ret.Error(1) } return r0, r1 } // MockFaviconRepository_FindFirst_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindFirst' type MockFaviconRepository_FindFirst_Call struct { *mock.Call } // FindFirst is a helper method to define mock.On call // - ctx context.Context // - keys []favicon.Key func (_e *MockFaviconRepository_Expecter) FindFirst(ctx any, keys any) *MockFaviconRepository_FindFirst_Call { return &MockFaviconRepository_FindFirst_Call{Call: _e.mock.On("FindFirst", ctx, keys)} } func (_c *MockFaviconRepository_FindFirst_Call) Run(run func(ctx context.Context, keys []favicon.Key)) *MockFaviconRepository_FindFirst_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 []favicon.Key if args[1] != nil { arg1 = args[1].([]favicon.Key) } run( arg0, arg1, ) }) return _c } func (_c *MockFaviconRepository_FindFirst_Call) Return(metadata *favicon.Metadata, err error) *MockFaviconRepository_FindFirst_Call { _c.Call.Return(metadata, err) return _c } func (_c *MockFaviconRepository_FindFirst_Call) RunAndReturn(run func(ctx context.Context, keys []favicon.Key) (*favicon.Metadata, error)) *MockFaviconRepository_FindFirst_Call { _c.Call.Return(run) return _c } // Get provides a mock function for the type MockFaviconRepository func (_mock *MockFaviconRepository) Get(ctx context.Context, key favicon.Key) (*favicon.Metadata, error) { ret := _mock.Called(ctx, key) if len(ret) == 0 { panic("no return value specified for Get") } var r0 *favicon.Metadata var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, favicon.Key) (*favicon.Metadata, error)); ok { return returnFunc(ctx, key) } if returnFunc, ok := ret.Get(0).(func(context.Context, favicon.Key) *favicon.Metadata); ok { r0 = returnFunc(ctx, key) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*favicon.Metadata) } } if returnFunc, ok := ret.Get(1).(func(context.Context, favicon.Key) error); ok { r1 = returnFunc(ctx, key) } else { r1 = ret.Error(1) } return r0, r1 } // MockFaviconRepository_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' type MockFaviconRepository_Get_Call struct { *mock.Call } // Get is a helper method to define mock.On call // - ctx context.Context // - key favicon.Key func (_e *MockFaviconRepository_Expecter) Get(ctx any, key any) *MockFaviconRepository_Get_Call { return &MockFaviconRepository_Get_Call{Call: _e.mock.On("Get", ctx, key)} } func (_c *MockFaviconRepository_Get_Call) Run(run func(ctx context.Context, key favicon.Key)) *MockFaviconRepository_Get_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 favicon.Key if args[1] != nil { arg1 = args[1].(favicon.Key) } run( arg0, arg1, ) }) return _c } func (_c *MockFaviconRepository_Get_Call) Return(metadata *favicon.Metadata, err error) *MockFaviconRepository_Get_Call { _c.Call.Return(metadata, err) return _c } func (_c *MockFaviconRepository_Get_Call) RunAndReturn(run func(ctx context.Context, key favicon.Key) (*favicon.Metadata, error)) *MockFaviconRepository_Get_Call { _c.Call.Return(run) return _c } // UpdateLastChecked provides a mock function for the type MockFaviconRepository func (_mock *MockFaviconRepository) UpdateLastChecked(ctx context.Context, key favicon.Key, contentHash string, checkedAt time.Time) error { ret := _mock.Called(ctx, key, contentHash, checkedAt) if len(ret) == 0 { panic("no return value specified for UpdateLastChecked") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, favicon.Key, string, time.Time) error); ok { r0 = returnFunc(ctx, key, contentHash, checkedAt) } else { r0 = ret.Error(0) } return r0 } // MockFaviconRepository_UpdateLastChecked_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateLastChecked' type MockFaviconRepository_UpdateLastChecked_Call struct { *mock.Call } // UpdateLastChecked is a helper method to define mock.On call // - ctx context.Context // - key favicon.Key // - contentHash string // - checkedAt time.Time func (_e *MockFaviconRepository_Expecter) UpdateLastChecked(ctx any, key any, contentHash any, checkedAt any) *MockFaviconRepository_UpdateLastChecked_Call { return &MockFaviconRepository_UpdateLastChecked_Call{Call: _e.mock.On("UpdateLastChecked", ctx, key, contentHash, checkedAt)} } func (_c *MockFaviconRepository_UpdateLastChecked_Call) Run(run func(ctx context.Context, key favicon.Key, contentHash string, checkedAt time.Time)) *MockFaviconRepository_UpdateLastChecked_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 favicon.Key if args[1] != nil { arg1 = args[1].(favicon.Key) } var arg2 string if args[2] != nil { arg2 = args[2].(string) } var arg3 time.Time if args[3] != nil { arg3 = args[3].(time.Time) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *MockFaviconRepository_UpdateLastChecked_Call) Return(err error) *MockFaviconRepository_UpdateLastChecked_Call { _c.Call.Return(err) return _c } func (_c *MockFaviconRepository_UpdateLastChecked_Call) RunAndReturn(run func(ctx context.Context, key favicon.Key, contentHash string, checkedAt time.Time) error) *MockFaviconRepository_UpdateLastChecked_Call { _c.Call.Return(run) return _c } // Upsert provides a mock function for the type MockFaviconRepository func (_mock *MockFaviconRepository) Upsert(ctx context.Context, meta favicon.Metadata) error { ret := _mock.Called(ctx, meta) if len(ret) == 0 { panic("no return value specified for Upsert") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, favicon.Metadata) error); ok { r0 = returnFunc(ctx, meta) } else { r0 = ret.Error(0) } return r0 } // MockFaviconRepository_Upsert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Upsert' type MockFaviconRepository_Upsert_Call struct { *mock.Call } // Upsert is a helper method to define mock.On call // - ctx context.Context // - meta favicon.Metadata func (_e *MockFaviconRepository_Expecter) Upsert(ctx any, meta any) *MockFaviconRepository_Upsert_Call { return &MockFaviconRepository_Upsert_Call{Call: _e.mock.On("Upsert", ctx, meta)} } func (_c *MockFaviconRepository_Upsert_Call) Run(run func(ctx context.Context, meta favicon.Metadata)) *MockFaviconRepository_Upsert_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 favicon.Metadata if args[1] != nil { arg1 = args[1].(favicon.Metadata) } run( arg0, arg1, ) }) return _c } func (_c *MockFaviconRepository_Upsert_Call) Return(err error) *MockFaviconRepository_Upsert_Call { _c.Call.Return(err) return _c } func (_c *MockFaviconRepository_Upsert_Call) RunAndReturn(run func(ctx context.Context, meta favicon.Metadata) error) *MockFaviconRepository_Upsert_Call { _c.Call.Return(run) return _c }