feat(repository): add database repository mocks for testing
- commit
- 5c92d2fc79037bd2e234817c249555c2722cfd16
- author
- brice · · 2025-12-16 17:15 UTC
- committer
- brice · · 2025-12-16 18:33 UTC
- parent
- afcf42b
- signature
- unsigned
6 files · +3050 -0
A internal/domain/repository/mocks/mock_content_whitelist_repository.go +280 -0
| @@ -0,0 +1,280 @@ | |||
| 1 | + | // Code generated by mockery; DO NOT EDIT. | |
| 2 | + | // github.com/vektra/mockery | |
| 3 | + | // template: testify | |
| 4 | + | ||
| 5 | + | package mocks | |
| 6 | + | ||
| 7 | + | import ( | |
| 8 | + | "context" | |
| 9 | + | ||
| 10 | + | mock "github.com/stretchr/testify/mock" | |
| 11 | + | ) | |
| 12 | + | ||
| 13 | + | // NewMockContentWhitelistRepository creates a new instance of MockContentWhitelistRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. | |
| 14 | + | // The first argument is typically a *testing.T value. | |
| 15 | + | func NewMockContentWhitelistRepository(t interface { | |
| 16 | + | mock.TestingT | |
| 17 | + | Cleanup(func()) | |
| 18 | + | }) *MockContentWhitelistRepository { | |
| 19 | + | mock := &MockContentWhitelistRepository{} | |
| 20 | + | mock.Mock.Test(t) | |
| 21 | + | ||
| 22 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| 23 | + | ||
| 24 | + | return mock | |
| 25 | + | } | |
| 26 | + | ||
| 27 | + | // MockContentWhitelistRepository is an autogenerated mock type for the ContentWhitelistRepository type | |
| 28 | + | type MockContentWhitelistRepository struct { | |
| 29 | + | mock.Mock | |
| 30 | + | } | |
| 31 | + | ||
| 32 | + | type MockContentWhitelistRepository_Expecter struct { | |
| 33 | + | mock *mock.Mock | |
| 34 | + | } | |
| 35 | + | ||
| 36 | + | func (_m *MockContentWhitelistRepository) EXPECT() *MockContentWhitelistRepository_Expecter { | |
| 37 | + | return &MockContentWhitelistRepository_Expecter{mock: &_m.Mock} | |
| 38 | + | } | |
| 39 | + | ||
| 40 | + | // Add provides a mock function for the type MockContentWhitelistRepository | |
| 41 | + | func (_mock *MockContentWhitelistRepository) Add(ctx context.Context, domain string) error { | |
| 42 | + | ret := _mock.Called(ctx, domain) | |
| 43 | + | ||
| 44 | + | if len(ret) == 0 { | |
| 45 | + | panic("no return value specified for Add") | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | var r0 error | |
| 49 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { | |
| 50 | + | r0 = returnFunc(ctx, domain) | |
| 51 | + | } else { | |
| 52 | + | r0 = ret.Error(0) | |
| 53 | + | } | |
| 54 | + | return r0 | |
| 55 | + | } | |
| 56 | + | ||
| 57 | + | // MockContentWhitelistRepository_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' | |
| 58 | + | type MockContentWhitelistRepository_Add_Call struct { | |
| 59 | + | *mock.Call | |
| 60 | + | } | |
| 61 | + | ||
| 62 | + | // Add is a helper method to define mock.On call | |
| 63 | + | // - ctx context.Context | |
| 64 | + | // - domain string | |
| 65 | + | func (_e *MockContentWhitelistRepository_Expecter) Add(ctx interface{}, domain interface{}) *MockContentWhitelistRepository_Add_Call { | |
| 66 | + | return &MockContentWhitelistRepository_Add_Call{Call: _e.mock.On("Add", ctx, domain)} | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | func (_c *MockContentWhitelistRepository_Add_Call) Run(run func(ctx context.Context, domain string)) *MockContentWhitelistRepository_Add_Call { | |
| 70 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 71 | + | var arg0 context.Context | |
| 72 | + | if args[0] != nil { | |
| 73 | + | arg0 = args[0].(context.Context) | |
| 74 | + | } | |
| 75 | + | var arg1 string | |
| 76 | + | if args[1] != nil { | |
| 77 | + | arg1 = args[1].(string) | |
| 78 | + | } | |
| 79 | + | run( | |
| 80 | + | arg0, | |
| 81 | + | arg1, | |
| 82 | + | ) | |
| 83 | + | }) | |
| 84 | + | return _c | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | func (_c *MockContentWhitelistRepository_Add_Call) Return(err error) *MockContentWhitelistRepository_Add_Call { | |
| 88 | + | _c.Call.Return(err) | |
| 89 | + | return _c | |
| 90 | + | } | |
| 91 | + | ||
| 92 | + | func (_c *MockContentWhitelistRepository_Add_Call) RunAndReturn(run func(ctx context.Context, domain string) error) *MockContentWhitelistRepository_Add_Call { | |
| 93 | + | _c.Call.Return(run) | |
| 94 | + | return _c | |
| 95 | + | } | |
| 96 | + | ||
| 97 | + | // Contains provides a mock function for the type MockContentWhitelistRepository | |
| 98 | + | func (_mock *MockContentWhitelistRepository) Contains(ctx context.Context, domain string) (bool, error) { | |
| 99 | + | ret := _mock.Called(ctx, domain) | |
| 100 | + | ||
| 101 | + | if len(ret) == 0 { | |
| 102 | + | panic("no return value specified for Contains") | |
| 103 | + | } | |
| 104 | + | ||
| 105 | + | var r0 bool | |
| 106 | + | var r1 error | |
| 107 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok { | |
| 108 | + | return returnFunc(ctx, domain) | |
| 109 | + | } | |
| 110 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) bool); ok { | |
| 111 | + | r0 = returnFunc(ctx, domain) | |
| 112 | + | } else { | |
| 113 | + | r0 = ret.Get(0).(bool) | |
| 114 | + | } | |
| 115 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { | |
| 116 | + | r1 = returnFunc(ctx, domain) | |
| 117 | + | } else { | |
| 118 | + | r1 = ret.Error(1) | |
| 119 | + | } | |
| 120 | + | return r0, r1 | |
| 121 | + | } | |
| 122 | + | ||
| 123 | + | // MockContentWhitelistRepository_Contains_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Contains' | |
| 124 | + | type MockContentWhitelistRepository_Contains_Call struct { | |
| 125 | + | *mock.Call | |
| 126 | + | } | |
| 127 | + | ||
| 128 | + | // Contains is a helper method to define mock.On call | |
| 129 | + | // - ctx context.Context | |
| 130 | + | // - domain string | |
| 131 | + | func (_e *MockContentWhitelistRepository_Expecter) Contains(ctx interface{}, domain interface{}) *MockContentWhitelistRepository_Contains_Call { | |
| 132 | + | return &MockContentWhitelistRepository_Contains_Call{Call: _e.mock.On("Contains", ctx, domain)} | |
| 133 | + | } | |
| 134 | + | ||
| 135 | + | func (_c *MockContentWhitelistRepository_Contains_Call) Run(run func(ctx context.Context, domain string)) *MockContentWhitelistRepository_Contains_Call { | |
| 136 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 137 | + | var arg0 context.Context | |
| 138 | + | if args[0] != nil { | |
| 139 | + | arg0 = args[0].(context.Context) | |
| 140 | + | } | |
| 141 | + | var arg1 string | |
| 142 | + | if args[1] != nil { | |
| 143 | + | arg1 = args[1].(string) | |
| 144 | + | } | |
| 145 | + | run( | |
| 146 | + | arg0, | |
| 147 | + | arg1, | |
| 148 | + | ) | |
| 149 | + | }) | |
| 150 | + | return _c | |
| 151 | + | } | |
| 152 | + | ||
| 153 | + | func (_c *MockContentWhitelistRepository_Contains_Call) Return(b bool, err error) *MockContentWhitelistRepository_Contains_Call { | |
| 154 | + | _c.Call.Return(b, err) | |
| 155 | + | return _c | |
| 156 | + | } | |
| 157 | + | ||
| 158 | + | func (_c *MockContentWhitelistRepository_Contains_Call) RunAndReturn(run func(ctx context.Context, domain string) (bool, error)) *MockContentWhitelistRepository_Contains_Call { | |
| 159 | + | _c.Call.Return(run) | |
| 160 | + | return _c | |
| 161 | + | } | |
| 162 | + | ||
| 163 | + | // GetAll provides a mock function for the type MockContentWhitelistRepository | |
| 164 | + | func (_mock *MockContentWhitelistRepository) GetAll(ctx context.Context) ([]string, error) { | |
| 165 | + | ret := _mock.Called(ctx) | |
| 166 | + | ||
| 167 | + | if len(ret) == 0 { | |
| 168 | + | panic("no return value specified for GetAll") | |
| 169 | + | } | |
| 170 | + | ||
| 171 | + | var r0 []string | |
| 172 | + | var r1 error | |
| 173 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) ([]string, error)); ok { | |
| 174 | + | return returnFunc(ctx) | |
| 175 | + | } | |
| 176 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) []string); ok { | |
| 177 | + | r0 = returnFunc(ctx) | |
| 178 | + | } else { | |
| 179 | + | if ret.Get(0) != nil { | |
| 180 | + | r0 = ret.Get(0).([]string) | |
| 181 | + | } | |
| 182 | + | } | |
| 183 | + | if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { | |
| 184 | + | r1 = returnFunc(ctx) | |
| 185 | + | } else { | |
| 186 | + | r1 = ret.Error(1) | |
| 187 | + | } | |
| 188 | + | return r0, r1 | |
| 189 | + | } | |
| 190 | + | ||
| 191 | + | // MockContentWhitelistRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' | |
| 192 | + | type MockContentWhitelistRepository_GetAll_Call struct { | |
| 193 | + | *mock.Call | |
| 194 | + | } | |
| 195 | + | ||
| 196 | + | // GetAll is a helper method to define mock.On call | |
| 197 | + | // - ctx context.Context | |
| 198 | + | func (_e *MockContentWhitelistRepository_Expecter) GetAll(ctx interface{}) *MockContentWhitelistRepository_GetAll_Call { | |
| 199 | + | return &MockContentWhitelistRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx)} | |
| 200 | + | } | |
| 201 | + | ||
| 202 | + | func (_c *MockContentWhitelistRepository_GetAll_Call) Run(run func(ctx context.Context)) *MockContentWhitelistRepository_GetAll_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 | + | run( | |
| 209 | + | arg0, | |
| 210 | + | ) | |
| 211 | + | }) | |
| 212 | + | return _c | |
| 213 | + | } | |
| 214 | + | ||
| 215 | + | func (_c *MockContentWhitelistRepository_GetAll_Call) Return(strings []string, err error) *MockContentWhitelistRepository_GetAll_Call { | |
| 216 | + | _c.Call.Return(strings, err) | |
| 217 | + | return _c | |
| 218 | + | } | |
| 219 | + | ||
| 220 | + | func (_c *MockContentWhitelistRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context) ([]string, error)) *MockContentWhitelistRepository_GetAll_Call { | |
| 221 | + | _c.Call.Return(run) | |
| 222 | + | return _c | |
| 223 | + | } | |
| 224 | + | ||
| 225 | + | // Remove provides a mock function for the type MockContentWhitelistRepository | |
| 226 | + | func (_mock *MockContentWhitelistRepository) Remove(ctx context.Context, domain string) error { | |
| 227 | + | ret := _mock.Called(ctx, domain) | |
| 228 | + | ||
| 229 | + | if len(ret) == 0 { | |
| 230 | + | panic("no return value specified for Remove") | |
| 231 | + | } | |
| 232 | + | ||
| 233 | + | var r0 error | |
| 234 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { | |
| 235 | + | r0 = returnFunc(ctx, domain) | |
| 236 | + | } else { | |
| 237 | + | r0 = ret.Error(0) | |
| 238 | + | } | |
| 239 | + | return r0 | |
| 240 | + | } | |
| 241 | + | ||
| 242 | + | // MockContentWhitelistRepository_Remove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remove' | |
| 243 | + | type MockContentWhitelistRepository_Remove_Call struct { | |
| 244 | + | *mock.Call | |
| 245 | + | } | |
| 246 | + | ||
| 247 | + | // Remove is a helper method to define mock.On call | |
| 248 | + | // - ctx context.Context | |
| 249 | + | // - domain string | |
| 250 | + | func (_e *MockContentWhitelistRepository_Expecter) Remove(ctx interface{}, domain interface{}) *MockContentWhitelistRepository_Remove_Call { | |
| 251 | + | return &MockContentWhitelistRepository_Remove_Call{Call: _e.mock.On("Remove", ctx, domain)} | |
| 252 | + | } | |
| 253 | + | ||
| 254 | + | func (_c *MockContentWhitelistRepository_Remove_Call) Run(run func(ctx context.Context, domain string)) *MockContentWhitelistRepository_Remove_Call { | |
| 255 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 256 | + | var arg0 context.Context | |
| 257 | + | if args[0] != nil { | |
| 258 | + | arg0 = args[0].(context.Context) | |
| 259 | + | } | |
| 260 | + | var arg1 string | |
| 261 | + | if args[1] != nil { | |
| 262 | + | arg1 = args[1].(string) | |
| 263 | + | } | |
| 264 | + | run( | |
| 265 | + | arg0, | |
| 266 | + | arg1, | |
| 267 | + | ) | |
| 268 | + | }) | |
| 269 | + | return _c | |
| 270 | + | } | |
| 271 | + | ||
| 272 | + | func (_c *MockContentWhitelistRepository_Remove_Call) Return(err error) *MockContentWhitelistRepository_Remove_Call { | |
| 273 | + | _c.Call.Return(err) | |
| 274 | + | return _c | |
| 275 | + | } | |
| 276 | + | ||
| 277 | + | func (_c *MockContentWhitelistRepository_Remove_Call) RunAndReturn(run func(ctx context.Context, domain string) error) *MockContentWhitelistRepository_Remove_Call { | |
| 278 | + | _c.Call.Return(run) | |
| 279 | + | return _c | |
| 280 | + | } | |
| @@ -0,0 +1,280 @@ | |||||
| 1 | + | // Code generated by mockery; DO NOT EDIT. | |||
| 2 | + | // github.com/vektra/mockery | |||
| 3 | + | // template: testify | |||
| 4 | + | ||||
| 5 | + | package mocks | |||
| 6 | + | ||||
| 7 | + | import ( | |||
| 8 | + | "context" | |||
| 9 | + | ||||
| 10 | + | mock "github.com/stretchr/testify/mock" | |||
| 11 | + | ) | |||
| 12 | + | ||||
| 13 | + | // NewMockContentWhitelistRepository creates a new instance of MockContentWhitelistRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. | |||
| 14 | + | // The first argument is typically a *testing.T value. | |||
| 15 | + | func NewMockContentWhitelistRepository(t interface { | |||
| 16 | + | mock.TestingT | |||
| 17 | + | Cleanup(func()) | |||
| 18 | + | }) *MockContentWhitelistRepository { | |||
| 19 | + | mock := &MockContentWhitelistRepository{} | |||
| 20 | + | mock.Mock.Test(t) | |||
| 21 | + | ||||
| 22 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |||
| 23 | + | ||||
| 24 | + | return mock | |||
| 25 | + | } | |||
| 26 | + | ||||
| 27 | + | // MockContentWhitelistRepository is an autogenerated mock type for the ContentWhitelistRepository type | |||
| 28 | + | type MockContentWhitelistRepository struct { | |||
| 29 | + | mock.Mock | |||
| 30 | + | } | |||
| 31 | + | ||||
| 32 | + | type MockContentWhitelistRepository_Expecter struct { | |||
| 33 | + | mock *mock.Mock | |||
| 34 | + | } | |||
| 35 | + | ||||
| 36 | + | func (_m *MockContentWhitelistRepository) EXPECT() *MockContentWhitelistRepository_Expecter { | |||
| 37 | + | return &MockContentWhitelistRepository_Expecter{mock: &_m.Mock} | |||
| 38 | + | } | |||
| 39 | + | ||||
| 40 | + | // Add provides a mock function for the type MockContentWhitelistRepository | |||
| 41 | + | func (_mock *MockContentWhitelistRepository) Add(ctx context.Context, domain string) error { | |||
| 42 | + | ret := _mock.Called(ctx, domain) | |||
| 43 | + | ||||
| 44 | + | if len(ret) == 0 { | |||
| 45 | + | panic("no return value specified for Add") | |||
| 46 | + | } | |||
| 47 | + | ||||
| 48 | + | var r0 error | |||
| 49 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { | |||
| 50 | + | r0 = returnFunc(ctx, domain) | |||
| 51 | + | } else { | |||
| 52 | + | r0 = ret.Error(0) | |||
| 53 | + | } | |||
| 54 | + | return r0 | |||
| 55 | + | } | |||
| 56 | + | ||||
| 57 | + | // MockContentWhitelistRepository_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' | |||
| 58 | + | type MockContentWhitelistRepository_Add_Call struct { | |||
| 59 | + | *mock.Call | |||
| 60 | + | } | |||
| 61 | + | ||||
| 62 | + | // Add is a helper method to define mock.On call | |||
| 63 | + | // - ctx context.Context | |||
| 64 | + | // - domain string | |||
| 65 | + | func (_e *MockContentWhitelistRepository_Expecter) Add(ctx interface{}, domain interface{}) *MockContentWhitelistRepository_Add_Call { | |||
| 66 | + | return &MockContentWhitelistRepository_Add_Call{Call: _e.mock.On("Add", ctx, domain)} | |||
| 67 | + | } | |||
| 68 | + | ||||
| 69 | + | func (_c *MockContentWhitelistRepository_Add_Call) Run(run func(ctx context.Context, domain string)) *MockContentWhitelistRepository_Add_Call { | |||
| 70 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 71 | + | var arg0 context.Context | |||
| 72 | + | if args[0] != nil { | |||
| 73 | + | arg0 = args[0].(context.Context) | |||
| 74 | + | } | |||
| 75 | + | var arg1 string | |||
| 76 | + | if args[1] != nil { | |||
| 77 | + | arg1 = args[1].(string) | |||
| 78 | + | } | |||
| 79 | + | run( | |||
| 80 | + | arg0, | |||
| 81 | + | arg1, | |||
| 82 | + | ) | |||
| 83 | + | }) | |||
| 84 | + | return _c | |||
| 85 | + | } | |||
| 86 | + | ||||
| 87 | + | func (_c *MockContentWhitelistRepository_Add_Call) Return(err error) *MockContentWhitelistRepository_Add_Call { | |||
| 88 | + | _c.Call.Return(err) | |||
| 89 | + | return _c | |||
| 90 | + | } | |||
| 91 | + | ||||
| 92 | + | func (_c *MockContentWhitelistRepository_Add_Call) RunAndReturn(run func(ctx context.Context, domain string) error) *MockContentWhitelistRepository_Add_Call { | |||
| 93 | + | _c.Call.Return(run) | |||
| 94 | + | return _c | |||
| 95 | + | } | |||
| 96 | + | ||||
| 97 | + | // Contains provides a mock function for the type MockContentWhitelistRepository | |||
| 98 | + | func (_mock *MockContentWhitelistRepository) Contains(ctx context.Context, domain string) (bool, error) { | |||
| 99 | + | ret := _mock.Called(ctx, domain) | |||
| 100 | + | ||||
| 101 | + | if len(ret) == 0 { | |||
| 102 | + | panic("no return value specified for Contains") | |||
| 103 | + | } | |||
| 104 | + | ||||
| 105 | + | var r0 bool | |||
| 106 | + | var r1 error | |||
| 107 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok { | |||
| 108 | + | return returnFunc(ctx, domain) | |||
| 109 | + | } | |||
| 110 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) bool); ok { | |||
| 111 | + | r0 = returnFunc(ctx, domain) | |||
| 112 | + | } else { | |||
| 113 | + | r0 = ret.Get(0).(bool) | |||
| 114 | + | } | |||
| 115 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { | |||
| 116 | + | r1 = returnFunc(ctx, domain) | |||
| 117 | + | } else { | |||
| 118 | + | r1 = ret.Error(1) | |||
| 119 | + | } | |||
| 120 | + | return r0, r1 | |||
| 121 | + | } | |||
| 122 | + | ||||
| 123 | + | // MockContentWhitelistRepository_Contains_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Contains' | |||
| 124 | + | type MockContentWhitelistRepository_Contains_Call struct { | |||
| 125 | + | *mock.Call | |||
| 126 | + | } | |||
| 127 | + | ||||
| 128 | + | // Contains is a helper method to define mock.On call | |||
| 129 | + | // - ctx context.Context | |||
| 130 | + | // - domain string | |||
| 131 | + | func (_e *MockContentWhitelistRepository_Expecter) Contains(ctx interface{}, domain interface{}) *MockContentWhitelistRepository_Contains_Call { | |||
| 132 | + | return &MockContentWhitelistRepository_Contains_Call{Call: _e.mock.On("Contains", ctx, domain)} | |||
| 133 | + | } | |||
| 134 | + | ||||
| 135 | + | func (_c *MockContentWhitelistRepository_Contains_Call) Run(run func(ctx context.Context, domain string)) *MockContentWhitelistRepository_Contains_Call { | |||
| 136 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 137 | + | var arg0 context.Context | |||
| 138 | + | if args[0] != nil { | |||
| 139 | + | arg0 = args[0].(context.Context) | |||
| 140 | + | } | |||
| 141 | + | var arg1 string | |||
| 142 | + | if args[1] != nil { | |||
| 143 | + | arg1 = args[1].(string) | |||
| 144 | + | } | |||
| 145 | + | run( | |||
| 146 | + | arg0, | |||
| 147 | + | arg1, | |||
| 148 | + | ) | |||
| 149 | + | }) | |||
| 150 | + | return _c | |||
| 151 | + | } | |||
| 152 | + | ||||
| 153 | + | func (_c *MockContentWhitelistRepository_Contains_Call) Return(b bool, err error) *MockContentWhitelistRepository_Contains_Call { | |||
| 154 | + | _c.Call.Return(b, err) | |||
| 155 | + | return _c | |||
| 156 | + | } | |||
| 157 | + | ||||
| 158 | + | func (_c *MockContentWhitelistRepository_Contains_Call) RunAndReturn(run func(ctx context.Context, domain string) (bool, error)) *MockContentWhitelistRepository_Contains_Call { | |||
| 159 | + | _c.Call.Return(run) | |||
| 160 | + | return _c | |||
| 161 | + | } | |||
| 162 | + | ||||
| 163 | + | // GetAll provides a mock function for the type MockContentWhitelistRepository | |||
| 164 | + | func (_mock *MockContentWhitelistRepository) GetAll(ctx context.Context) ([]string, error) { | |||
| 165 | + | ret := _mock.Called(ctx) | |||
| 166 | + | ||||
| 167 | + | if len(ret) == 0 { | |||
| 168 | + | panic("no return value specified for GetAll") | |||
| 169 | + | } | |||
| 170 | + | ||||
| 171 | + | var r0 []string | |||
| 172 | + | var r1 error | |||
| 173 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) ([]string, error)); ok { | |||
| 174 | + | return returnFunc(ctx) | |||
| 175 | + | } | |||
| 176 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) []string); ok { | |||
| 177 | + | r0 = returnFunc(ctx) | |||
| 178 | + | } else { | |||
| 179 | + | if ret.Get(0) != nil { | |||
| 180 | + | r0 = ret.Get(0).([]string) | |||
| 181 | + | } | |||
| 182 | + | } | |||
| 183 | + | if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { | |||
| 184 | + | r1 = returnFunc(ctx) | |||
| 185 | + | } else { | |||
| 186 | + | r1 = ret.Error(1) | |||
| 187 | + | } | |||
| 188 | + | return r0, r1 | |||
| 189 | + | } | |||
| 190 | + | ||||
| 191 | + | // MockContentWhitelistRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' | |||
| 192 | + | type MockContentWhitelistRepository_GetAll_Call struct { | |||
| 193 | + | *mock.Call | |||
| 194 | + | } | |||
| 195 | + | ||||
| 196 | + | // GetAll is a helper method to define mock.On call | |||
| 197 | + | // - ctx context.Context | |||
| 198 | + | func (_e *MockContentWhitelistRepository_Expecter) GetAll(ctx interface{}) *MockContentWhitelistRepository_GetAll_Call { | |||
| 199 | + | return &MockContentWhitelistRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx)} | |||
| 200 | + | } | |||
| 201 | + | ||||
| 202 | + | func (_c *MockContentWhitelistRepository_GetAll_Call) Run(run func(ctx context.Context)) *MockContentWhitelistRepository_GetAll_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 | + | run( | |||
| 209 | + | arg0, | |||
| 210 | + | ) | |||
| 211 | + | }) | |||
| 212 | + | return _c | |||
| 213 | + | } | |||
| 214 | + | ||||
| 215 | + | func (_c *MockContentWhitelistRepository_GetAll_Call) Return(strings []string, err error) *MockContentWhitelistRepository_GetAll_Call { | |||
| 216 | + | _c.Call.Return(strings, err) | |||
| 217 | + | return _c | |||
| 218 | + | } | |||
| 219 | + | ||||
| 220 | + | func (_c *MockContentWhitelistRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context) ([]string, error)) *MockContentWhitelistRepository_GetAll_Call { | |||
| 221 | + | _c.Call.Return(run) | |||
| 222 | + | return _c | |||
| 223 | + | } | |||
| 224 | + | ||||
| 225 | + | // Remove provides a mock function for the type MockContentWhitelistRepository | |||
| 226 | + | func (_mock *MockContentWhitelistRepository) Remove(ctx context.Context, domain string) error { | |||
| 227 | + | ret := _mock.Called(ctx, domain) | |||
| 228 | + | ||||
| 229 | + | if len(ret) == 0 { | |||
| 230 | + | panic("no return value specified for Remove") | |||
| 231 | + | } | |||
| 232 | + | ||||
| 233 | + | var r0 error | |||
| 234 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { | |||
| 235 | + | r0 = returnFunc(ctx, domain) | |||
| 236 | + | } else { | |||
| 237 | + | r0 = ret.Error(0) | |||
| 238 | + | } | |||
| 239 | + | return r0 | |||
| 240 | + | } | |||
| 241 | + | ||||
| 242 | + | // MockContentWhitelistRepository_Remove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remove' | |||
| 243 | + | type MockContentWhitelistRepository_Remove_Call struct { | |||
| 244 | + | *mock.Call | |||
| 245 | + | } | |||
| 246 | + | ||||
| 247 | + | // Remove is a helper method to define mock.On call | |||
| 248 | + | // - ctx context.Context | |||
| 249 | + | // - domain string | |||
| 250 | + | func (_e *MockContentWhitelistRepository_Expecter) Remove(ctx interface{}, domain interface{}) *MockContentWhitelistRepository_Remove_Call { | |||
| 251 | + | return &MockContentWhitelistRepository_Remove_Call{Call: _e.mock.On("Remove", ctx, domain)} | |||
| 252 | + | } | |||
| 253 | + | ||||
| 254 | + | func (_c *MockContentWhitelistRepository_Remove_Call) Run(run func(ctx context.Context, domain string)) *MockContentWhitelistRepository_Remove_Call { | |||
| 255 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 256 | + | var arg0 context.Context | |||
| 257 | + | if args[0] != nil { | |||
| 258 | + | arg0 = args[0].(context.Context) | |||
| 259 | + | } | |||
| 260 | + | var arg1 string | |||
| 261 | + | if args[1] != nil { | |||
| 262 | + | arg1 = args[1].(string) | |||
| 263 | + | } | |||
| 264 | + | run( | |||
| 265 | + | arg0, | |||
| 266 | + | arg1, | |||
| 267 | + | ) | |||
| 268 | + | }) | |||
| 269 | + | return _c | |||
| 270 | + | } | |||
| 271 | + | ||||
| 272 | + | func (_c *MockContentWhitelistRepository_Remove_Call) Return(err error) *MockContentWhitelistRepository_Remove_Call { | |||
| 273 | + | _c.Call.Return(err) | |||
| 274 | + | return _c | |||
| 275 | + | } | |||
| 276 | + | ||||
| 277 | + | func (_c *MockContentWhitelistRepository_Remove_Call) RunAndReturn(run func(ctx context.Context, domain string) error) *MockContentWhitelistRepository_Remove_Call { | |||
| 278 | + | _c.Call.Return(run) | |||
| 279 | + | return _c | |||
| 280 | + | } | |||
A internal/domain/repository/mocks/mock_favorite_repository.go +676 -0
| @@ -0,0 +1,676 @@ | |||
| 1 | + | // Code generated by mockery; DO NOT EDIT. | |
| 2 | + | // github.com/vektra/mockery | |
| 3 | + | // template: testify | |
| 4 | + | ||
| 5 | + | package mocks | |
| 6 | + | ||
| 7 | + | import ( | |
| 8 | + | "context" | |
| 9 | + | ||
| 10 | + | "github.com/bnema/dumber/internal/domain/entity" | |
| 11 | + | mock "github.com/stretchr/testify/mock" | |
| 12 | + | ) | |
| 13 | + | ||
| 14 | + | // NewMockFavoriteRepository creates a new instance of MockFavoriteRepository. 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. | |
| 16 | + | func NewMockFavoriteRepository(t interface { | |
| 17 | + | mock.TestingT | |
| 18 | + | Cleanup(func()) | |
| 19 | + | }) *MockFavoriteRepository { | |
| 20 | + | mock := &MockFavoriteRepository{} | |
| 21 | + | mock.Mock.Test(t) | |
| 22 | + | ||
| 23 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| 24 | + | ||
| 25 | + | return mock | |
| 26 | + | } | |
| 27 | + | ||
| 28 | + | // MockFavoriteRepository is an autogenerated mock type for the FavoriteRepository type | |
| 29 | + | type MockFavoriteRepository struct { | |
| 30 | + | mock.Mock | |
| 31 | + | } | |
| 32 | + | ||
| 33 | + | type MockFavoriteRepository_Expecter struct { | |
| 34 | + | mock *mock.Mock | |
| 35 | + | } | |
| 36 | + | ||
| 37 | + | func (_m *MockFavoriteRepository) EXPECT() *MockFavoriteRepository_Expecter { | |
| 38 | + | return &MockFavoriteRepository_Expecter{mock: &_m.Mock} | |
| 39 | + | } | |
| 40 | + | ||
| 41 | + | // Delete provides a mock function for the type MockFavoriteRepository | |
| 42 | + | func (_mock *MockFavoriteRepository) Delete(ctx context.Context, id entity.FavoriteID) error { | |
| 43 | + | ret := _mock.Called(ctx, id) | |
| 44 | + | ||
| 45 | + | if len(ret) == 0 { | |
| 46 | + | panic("no return value specified for Delete") | |
| 47 | + | } | |
| 48 | + | ||
| 49 | + | var r0 error | |
| 50 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) error); ok { | |
| 51 | + | r0 = returnFunc(ctx, id) | |
| 52 | + | } else { | |
| 53 | + | r0 = ret.Error(0) | |
| 54 | + | } | |
| 55 | + | return r0 | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | // MockFavoriteRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' | |
| 59 | + | type MockFavoriteRepository_Delete_Call struct { | |
| 60 | + | *mock.Call | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // Delete is a helper method to define mock.On call | |
| 64 | + | // - ctx context.Context | |
| 65 | + | // - id entity.FavoriteID | |
| 66 | + | func (_e *MockFavoriteRepository_Expecter) Delete(ctx interface{}, id interface{}) *MockFavoriteRepository_Delete_Call { | |
| 67 | + | return &MockFavoriteRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} | |
| 68 | + | } | |
| 69 | + | ||
| 70 | + | func (_c *MockFavoriteRepository_Delete_Call) Run(run func(ctx context.Context, id entity.FavoriteID)) *MockFavoriteRepository_Delete_Call { | |
| 71 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 72 | + | var arg0 context.Context | |
| 73 | + | if args[0] != nil { | |
| 74 | + | arg0 = args[0].(context.Context) | |
| 75 | + | } | |
| 76 | + | var arg1 entity.FavoriteID | |
| 77 | + | if args[1] != nil { | |
| 78 | + | arg1 = args[1].(entity.FavoriteID) | |
| 79 | + | } | |
| 80 | + | run( | |
| 81 | + | arg0, | |
| 82 | + | arg1, | |
| 83 | + | ) | |
| 84 | + | }) | |
| 85 | + | return _c | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | func (_c *MockFavoriteRepository_Delete_Call) Return(err error) *MockFavoriteRepository_Delete_Call { | |
| 89 | + | _c.Call.Return(err) | |
| 90 | + | return _c | |
| 91 | + | } | |
| 92 | + | ||
| 93 | + | func (_c *MockFavoriteRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, id entity.FavoriteID) error) *MockFavoriteRepository_Delete_Call { | |
| 94 | + | _c.Call.Return(run) | |
| 95 | + | return _c | |
| 96 | + | } | |
| 97 | + | ||
| 98 | + | // FindByID provides a mock function for the type MockFavoriteRepository | |
| 99 | + | func (_mock *MockFavoriteRepository) FindByID(ctx context.Context, id entity.FavoriteID) (*entity.Favorite, error) { | |
| 100 | + | ret := _mock.Called(ctx, id) | |
| 101 | + | ||
| 102 | + | if len(ret) == 0 { | |
| 103 | + | panic("no return value specified for FindByID") | |
| 104 | + | } | |
| 105 | + | ||
| 106 | + | var r0 *entity.Favorite | |
| 107 | + | var r1 error | |
| 108 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) (*entity.Favorite, error)); ok { | |
| 109 | + | return returnFunc(ctx, id) | |
| 110 | + | } | |
| 111 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) *entity.Favorite); ok { | |
| 112 | + | r0 = returnFunc(ctx, id) | |
| 113 | + | } else { | |
| 114 | + | if ret.Get(0) != nil { | |
| 115 | + | r0 = ret.Get(0).(*entity.Favorite) | |
| 116 | + | } | |
| 117 | + | } | |
| 118 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, entity.FavoriteID) error); ok { | |
| 119 | + | r1 = returnFunc(ctx, id) | |
| 120 | + | } else { | |
| 121 | + | r1 = ret.Error(1) | |
| 122 | + | } | |
| 123 | + | return r0, r1 | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | // MockFavoriteRepository_FindByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByID' | |
| 127 | + | type MockFavoriteRepository_FindByID_Call struct { | |
| 128 | + | *mock.Call | |
| 129 | + | } | |
| 130 | + | ||
| 131 | + | // FindByID is a helper method to define mock.On call | |
| 132 | + | // - ctx context.Context | |
| 133 | + | // - id entity.FavoriteID | |
| 134 | + | func (_e *MockFavoriteRepository_Expecter) FindByID(ctx interface{}, id interface{}) *MockFavoriteRepository_FindByID_Call { | |
| 135 | + | return &MockFavoriteRepository_FindByID_Call{Call: _e.mock.On("FindByID", ctx, id)} | |
| 136 | + | } | |
| 137 | + | ||
| 138 | + | func (_c *MockFavoriteRepository_FindByID_Call) Run(run func(ctx context.Context, id entity.FavoriteID)) *MockFavoriteRepository_FindByID_Call { | |
| 139 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 140 | + | var arg0 context.Context | |
| 141 | + | if args[0] != nil { | |
| 142 | + | arg0 = args[0].(context.Context) | |
| 143 | + | } | |
| 144 | + | var arg1 entity.FavoriteID | |
| 145 | + | if args[1] != nil { | |
| 146 | + | arg1 = args[1].(entity.FavoriteID) | |
| 147 | + | } | |
| 148 | + | run( | |
| 149 | + | arg0, | |
| 150 | + | arg1, | |
| 151 | + | ) | |
| 152 | + | }) | |
| 153 | + | return _c | |
| 154 | + | } | |
| 155 | + | ||
| 156 | + | func (_c *MockFavoriteRepository_FindByID_Call) Return(favorite *entity.Favorite, err error) *MockFavoriteRepository_FindByID_Call { | |
| 157 | + | _c.Call.Return(favorite, err) | |
| 158 | + | return _c | |
| 159 | + | } | |
| 160 | + | ||
| 161 | + | func (_c *MockFavoriteRepository_FindByID_Call) RunAndReturn(run func(ctx context.Context, id entity.FavoriteID) (*entity.Favorite, error)) *MockFavoriteRepository_FindByID_Call { | |
| 162 | + | _c.Call.Return(run) | |
| 163 | + | return _c | |
| 164 | + | } | |
| 165 | + | ||
| 166 | + | // FindByURL provides a mock function for the type MockFavoriteRepository | |
| 167 | + | func (_mock *MockFavoriteRepository) FindByURL(ctx context.Context, url string) (*entity.Favorite, error) { | |
| 168 | + | ret := _mock.Called(ctx, url) | |
| 169 | + | ||
| 170 | + | if len(ret) == 0 { | |
| 171 | + | panic("no return value specified for FindByURL") | |
| 172 | + | } | |
| 173 | + | ||
| 174 | + | var r0 *entity.Favorite | |
| 175 | + | var r1 error | |
| 176 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*entity.Favorite, error)); ok { | |
| 177 | + | return returnFunc(ctx, url) | |
| 178 | + | } | |
| 179 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) *entity.Favorite); ok { | |
| 180 | + | r0 = returnFunc(ctx, url) | |
| 181 | + | } else { | |
| 182 | + | if ret.Get(0) != nil { | |
| 183 | + | r0 = ret.Get(0).(*entity.Favorite) | |
| 184 | + | } | |
| 185 | + | } | |
| 186 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { | |
| 187 | + | r1 = returnFunc(ctx, url) | |
| 188 | + | } else { | |
| 189 | + | r1 = ret.Error(1) | |
| 190 | + | } | |
| 191 | + | return r0, r1 | |
| 192 | + | } | |
| 193 | + | ||
| 194 | + | // MockFavoriteRepository_FindByURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByURL' | |
| 195 | + | type MockFavoriteRepository_FindByURL_Call struct { | |
| 196 | + | *mock.Call | |
| 197 | + | } | |
| 198 | + | ||
| 199 | + | // FindByURL is a helper method to define mock.On call | |
| 200 | + | // - ctx context.Context | |
| 201 | + | // - url string | |
| 202 | + | func (_e *MockFavoriteRepository_Expecter) FindByURL(ctx interface{}, url interface{}) *MockFavoriteRepository_FindByURL_Call { | |
| 203 | + | return &MockFavoriteRepository_FindByURL_Call{Call: _e.mock.On("FindByURL", ctx, url)} | |
| 204 | + | } | |
| 205 | + | ||
| 206 | + | func (_c *MockFavoriteRepository_FindByURL_Call) Run(run func(ctx context.Context, url string)) *MockFavoriteRepository_FindByURL_Call { | |
| 207 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 208 | + | var arg0 context.Context | |
| 209 | + | if args[0] != nil { | |
| 210 | + | arg0 = args[0].(context.Context) | |
| 211 | + | } | |
| 212 | + | var arg1 string | |
| 213 | + | if args[1] != nil { | |
| 214 | + | arg1 = args[1].(string) | |
| 215 | + | } | |
| 216 | + | run( | |
| 217 | + | arg0, | |
| 218 | + | arg1, | |
| 219 | + | ) | |
| 220 | + | }) | |
| 221 | + | return _c | |
| 222 | + | } | |
| 223 | + | ||
| 224 | + | func (_c *MockFavoriteRepository_FindByURL_Call) Return(favorite *entity.Favorite, err error) *MockFavoriteRepository_FindByURL_Call { | |
| 225 | + | _c.Call.Return(favorite, err) | |
| 226 | + | return _c | |
| 227 | + | } | |
| 228 | + | ||
| 229 | + | func (_c *MockFavoriteRepository_FindByURL_Call) RunAndReturn(run func(ctx context.Context, url string) (*entity.Favorite, error)) *MockFavoriteRepository_FindByURL_Call { | |
| 230 | + | _c.Call.Return(run) | |
| 231 | + | return _c | |
| 232 | + | } | |
| 233 | + | ||
| 234 | + | // GetAll provides a mock function for the type MockFavoriteRepository | |
| 235 | + | func (_mock *MockFavoriteRepository) GetAll(ctx context.Context) ([]*entity.Favorite, error) { | |
| 236 | + | ret := _mock.Called(ctx) | |
| 237 | + | ||
| 238 | + | if len(ret) == 0 { | |
| 239 | + | panic("no return value specified for GetAll") | |
| 240 | + | } | |
| 241 | + | ||
| 242 | + | var r0 []*entity.Favorite | |
| 243 | + | var r1 error | |
| 244 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.Favorite, error)); ok { | |
| 245 | + | return returnFunc(ctx) | |
| 246 | + | } | |
| 247 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.Favorite); ok { | |
| 248 | + | r0 = returnFunc(ctx) | |
| 249 | + | } else { | |
| 250 | + | if ret.Get(0) != nil { | |
| 251 | + | r0 = ret.Get(0).([]*entity.Favorite) | |
| 252 | + | } | |
| 253 | + | } | |
| 254 | + | if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { | |
| 255 | + | r1 = returnFunc(ctx) | |
| 256 | + | } else { | |
| 257 | + | r1 = ret.Error(1) | |
| 258 | + | } | |
| 259 | + | return r0, r1 | |
| 260 | + | } | |
| 261 | + | ||
| 262 | + | // MockFavoriteRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' | |
| 263 | + | type MockFavoriteRepository_GetAll_Call struct { | |
| 264 | + | *mock.Call | |
| 265 | + | } | |
| 266 | + | ||
| 267 | + | // GetAll is a helper method to define mock.On call | |
| 268 | + | // - ctx context.Context | |
| 269 | + | func (_e *MockFavoriteRepository_Expecter) GetAll(ctx interface{}) *MockFavoriteRepository_GetAll_Call { | |
| 270 | + | return &MockFavoriteRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx)} | |
| 271 | + | } | |
| 272 | + | ||
| 273 | + | func (_c *MockFavoriteRepository_GetAll_Call) Run(run func(ctx context.Context)) *MockFavoriteRepository_GetAll_Call { | |
| 274 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 275 | + | var arg0 context.Context | |
| 276 | + | if args[0] != nil { | |
| 277 | + | arg0 = args[0].(context.Context) | |
| 278 | + | } | |
| 279 | + | run( | |
| 280 | + | arg0, | |
| 281 | + | ) | |
| 282 | + | }) | |
| 283 | + | return _c | |
| 284 | + | } | |
| 285 | + | ||
| 286 | + | func (_c *MockFavoriteRepository_GetAll_Call) Return(favorites []*entity.Favorite, err error) *MockFavoriteRepository_GetAll_Call { | |
| 287 | + | _c.Call.Return(favorites, err) | |
| 288 | + | return _c | |
| 289 | + | } | |
| 290 | + | ||
| 291 | + | func (_c *MockFavoriteRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.Favorite, error)) *MockFavoriteRepository_GetAll_Call { | |
| 292 | + | _c.Call.Return(run) | |
| 293 | + | return _c | |
| 294 | + | } | |
| 295 | + | ||
| 296 | + | // GetByFolder provides a mock function for the type MockFavoriteRepository | |
| 297 | + | func (_mock *MockFavoriteRepository) GetByFolder(ctx context.Context, folderID *entity.FolderID) ([]*entity.Favorite, error) { | |
| 298 | + | ret := _mock.Called(ctx, folderID) | |
| 299 | + | ||
| 300 | + | if len(ret) == 0 { | |
| 301 | + | panic("no return value specified for GetByFolder") | |
| 302 | + | } | |
| 303 | + | ||
| 304 | + | var r0 []*entity.Favorite | |
| 305 | + | var r1 error | |
| 306 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.FolderID) ([]*entity.Favorite, error)); ok { | |
| 307 | + | return returnFunc(ctx, folderID) | |
| 308 | + | } | |
| 309 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.FolderID) []*entity.Favorite); ok { | |
| 310 | + | r0 = returnFunc(ctx, folderID) | |
| 311 | + | } else { | |
| 312 | + | if ret.Get(0) != nil { | |
| 313 | + | r0 = ret.Get(0).([]*entity.Favorite) | |
| 314 | + | } | |
| 315 | + | } | |
| 316 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, *entity.FolderID) error); ok { | |
| 317 | + | r1 = returnFunc(ctx, folderID) | |
| 318 | + | } else { | |
| 319 | + | r1 = ret.Error(1) | |
| 320 | + | } | |
| 321 | + | return r0, r1 | |
| 322 | + | } | |
| 323 | + | ||
| 324 | + | // MockFavoriteRepository_GetByFolder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByFolder' | |
| 325 | + | type MockFavoriteRepository_GetByFolder_Call struct { | |
| 326 | + | *mock.Call | |
| 327 | + | } | |
| 328 | + | ||
| 329 | + | // GetByFolder is a helper method to define mock.On call | |
| 330 | + | // - ctx context.Context | |
| 331 | + | // - folderID *entity.FolderID | |
| 332 | + | func (_e *MockFavoriteRepository_Expecter) GetByFolder(ctx interface{}, folderID interface{}) *MockFavoriteRepository_GetByFolder_Call { | |
| 333 | + | return &MockFavoriteRepository_GetByFolder_Call{Call: _e.mock.On("GetByFolder", ctx, folderID)} | |
| 334 | + | } | |
| 335 | + | ||
| 336 | + | func (_c *MockFavoriteRepository_GetByFolder_Call) Run(run func(ctx context.Context, folderID *entity.FolderID)) *MockFavoriteRepository_GetByFolder_Call { | |
| 337 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 338 | + | var arg0 context.Context | |
| 339 | + | if args[0] != nil { | |
| 340 | + | arg0 = args[0].(context.Context) | |
| 341 | + | } | |
| 342 | + | var arg1 *entity.FolderID | |
| 343 | + | if args[1] != nil { | |
| 344 | + | arg1 = args[1].(*entity.FolderID) | |
| 345 | + | } | |
| 346 | + | run( | |
| 347 | + | arg0, | |
| 348 | + | arg1, | |
| 349 | + | ) | |
| 350 | + | }) | |
| 351 | + | return _c | |
| 352 | + | } | |
| 353 | + | ||
| 354 | + | func (_c *MockFavoriteRepository_GetByFolder_Call) Return(favorites []*entity.Favorite, err error) *MockFavoriteRepository_GetByFolder_Call { | |
| 355 | + | _c.Call.Return(favorites, err) | |
| 356 | + | return _c | |
| 357 | + | } | |
| 358 | + | ||
| 359 | + | func (_c *MockFavoriteRepository_GetByFolder_Call) RunAndReturn(run func(ctx context.Context, folderID *entity.FolderID) ([]*entity.Favorite, error)) *MockFavoriteRepository_GetByFolder_Call { | |
| 360 | + | _c.Call.Return(run) | |
| 361 | + | return _c | |
| 362 | + | } | |
| 363 | + | ||
| 364 | + | // GetByShortcut provides a mock function for the type MockFavoriteRepository | |
| 365 | + | func (_mock *MockFavoriteRepository) GetByShortcut(ctx context.Context, key int) (*entity.Favorite, error) { | |
| 366 | + | ret := _mock.Called(ctx, key) | |
| 367 | + | ||
| 368 | + | if len(ret) == 0 { | |
| 369 | + | panic("no return value specified for GetByShortcut") | |
| 370 | + | } | |
| 371 | + | ||
| 372 | + | var r0 *entity.Favorite | |
| 373 | + | var r1 error | |
| 374 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, int) (*entity.Favorite, error)); ok { | |
| 375 | + | return returnFunc(ctx, key) | |
| 376 | + | } | |
| 377 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, int) *entity.Favorite); ok { | |
| 378 | + | r0 = returnFunc(ctx, key) | |
| 379 | + | } else { | |
| 380 | + | if ret.Get(0) != nil { | |
| 381 | + | r0 = ret.Get(0).(*entity.Favorite) | |
| 382 | + | } | |
| 383 | + | } | |
| 384 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, int) error); ok { | |
| 385 | + | r1 = returnFunc(ctx, key) | |
| 386 | + | } else { | |
| 387 | + | r1 = ret.Error(1) | |
| 388 | + | } | |
| 389 | + | return r0, r1 | |
| 390 | + | } | |
| 391 | + | ||
| 392 | + | // MockFavoriteRepository_GetByShortcut_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByShortcut' | |
| 393 | + | type MockFavoriteRepository_GetByShortcut_Call struct { | |
| 394 | + | *mock.Call | |
| 395 | + | } | |
| 396 | + | ||
| 397 | + | // GetByShortcut is a helper method to define mock.On call | |
| 398 | + | // - ctx context.Context | |
| 399 | + | // - key int | |
| 400 | + | func (_e *MockFavoriteRepository_Expecter) GetByShortcut(ctx interface{}, key interface{}) *MockFavoriteRepository_GetByShortcut_Call { | |
| 401 | + | return &MockFavoriteRepository_GetByShortcut_Call{Call: _e.mock.On("GetByShortcut", ctx, key)} | |
| 402 | + | } | |
| 403 | + | ||
| 404 | + | func (_c *MockFavoriteRepository_GetByShortcut_Call) Run(run func(ctx context.Context, key int)) *MockFavoriteRepository_GetByShortcut_Call { | |
| 405 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 406 | + | var arg0 context.Context | |
| 407 | + | if args[0] != nil { | |
| 408 | + | arg0 = args[0].(context.Context) | |
| 409 | + | } | |
| 410 | + | var arg1 int | |
| 411 | + | if args[1] != nil { | |
| 412 | + | arg1 = args[1].(int) | |
| 413 | + | } | |
| 414 | + | run( | |
| 415 | + | arg0, | |
| 416 | + | arg1, | |
| 417 | + | ) | |
| 418 | + | }) | |
| 419 | + | return _c | |
| 420 | + | } | |
| 421 | + | ||
| 422 | + | func (_c *MockFavoriteRepository_GetByShortcut_Call) Return(favorite *entity.Favorite, err error) *MockFavoriteRepository_GetByShortcut_Call { | |
| 423 | + | _c.Call.Return(favorite, err) | |
| 424 | + | return _c | |
| 425 | + | } | |
| 426 | + | ||
| 427 | + | func (_c *MockFavoriteRepository_GetByShortcut_Call) RunAndReturn(run func(ctx context.Context, key int) (*entity.Favorite, error)) *MockFavoriteRepository_GetByShortcut_Call { | |
| 428 | + | _c.Call.Return(run) | |
| 429 | + | return _c | |
| 430 | + | } | |
| 431 | + | ||
| 432 | + | // Save provides a mock function for the type MockFavoriteRepository | |
| 433 | + | func (_mock *MockFavoriteRepository) Save(ctx context.Context, fav *entity.Favorite) error { | |
| 434 | + | ret := _mock.Called(ctx, fav) | |
| 435 | + | ||
| 436 | + | if len(ret) == 0 { | |
| 437 | + | panic("no return value specified for Save") | |
| 438 | + | } | |
| 439 | + | ||
| 440 | + | var r0 error | |
| 441 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.Favorite) error); ok { | |
| 442 | + | r0 = returnFunc(ctx, fav) | |
| 443 | + | } else { | |
| 444 | + | r0 = ret.Error(0) | |
| 445 | + | } | |
| 446 | + | return r0 | |
| 447 | + | } | |
| 448 | + | ||
| 449 | + | // MockFavoriteRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' | |
| 450 | + | type MockFavoriteRepository_Save_Call struct { | |
| 451 | + | *mock.Call | |
| 452 | + | } | |
| 453 | + | ||
| 454 | + | // Save is a helper method to define mock.On call | |
| 455 | + | // - ctx context.Context | |
| 456 | + | // - fav *entity.Favorite | |
| 457 | + | func (_e *MockFavoriteRepository_Expecter) Save(ctx interface{}, fav interface{}) *MockFavoriteRepository_Save_Call { | |
| 458 | + | return &MockFavoriteRepository_Save_Call{Call: _e.mock.On("Save", ctx, fav)} | |
| 459 | + | } | |
| 460 | + | ||
| 461 | + | func (_c *MockFavoriteRepository_Save_Call) Run(run func(ctx context.Context, fav *entity.Favorite)) *MockFavoriteRepository_Save_Call { | |
| 462 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 463 | + | var arg0 context.Context | |
| 464 | + | if args[0] != nil { | |
| 465 | + | arg0 = args[0].(context.Context) | |
| 466 | + | } | |
| 467 | + | var arg1 *entity.Favorite | |
| 468 | + | if args[1] != nil { | |
| 469 | + | arg1 = args[1].(*entity.Favorite) | |
| 470 | + | } | |
| 471 | + | run( | |
| 472 | + | arg0, | |
| 473 | + | arg1, | |
| 474 | + | ) | |
| 475 | + | }) | |
| 476 | + | return _c | |
| 477 | + | } | |
| 478 | + | ||
| 479 | + | func (_c *MockFavoriteRepository_Save_Call) Return(err error) *MockFavoriteRepository_Save_Call { | |
| 480 | + | _c.Call.Return(err) | |
| 481 | + | return _c | |
| 482 | + | } | |
| 483 | + | ||
| 484 | + | func (_c *MockFavoriteRepository_Save_Call) RunAndReturn(run func(ctx context.Context, fav *entity.Favorite) error) *MockFavoriteRepository_Save_Call { | |
| 485 | + | _c.Call.Return(run) | |
| 486 | + | return _c | |
| 487 | + | } | |
| 488 | + | ||
| 489 | + | // SetFolder provides a mock function for the type MockFavoriteRepository | |
| 490 | + | func (_mock *MockFavoriteRepository) SetFolder(ctx context.Context, id entity.FavoriteID, folderID *entity.FolderID) error { | |
| 491 | + | ret := _mock.Called(ctx, id, folderID) | |
| 492 | + | ||
| 493 | + | if len(ret) == 0 { | |
| 494 | + | panic("no return value specified for SetFolder") | |
| 495 | + | } | |
| 496 | + | ||
| 497 | + | var r0 error | |
| 498 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID, *entity.FolderID) error); ok { | |
| 499 | + | r0 = returnFunc(ctx, id, folderID) | |
| 500 | + | } else { | |
| 501 | + | r0 = ret.Error(0) | |
| 502 | + | } | |
| 503 | + | return r0 | |
| 504 | + | } | |
| 505 | + | ||
| 506 | + | // MockFavoriteRepository_SetFolder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFolder' | |
| 507 | + | type MockFavoriteRepository_SetFolder_Call struct { | |
| 508 | + | *mock.Call | |
| 509 | + | } | |
| 510 | + | ||
| 511 | + | // SetFolder is a helper method to define mock.On call | |
| 512 | + | // - ctx context.Context | |
| 513 | + | // - id entity.FavoriteID | |
| 514 | + | // - folderID *entity.FolderID | |
| 515 | + | func (_e *MockFavoriteRepository_Expecter) SetFolder(ctx interface{}, id interface{}, folderID interface{}) *MockFavoriteRepository_SetFolder_Call { | |
| 516 | + | return &MockFavoriteRepository_SetFolder_Call{Call: _e.mock.On("SetFolder", ctx, id, folderID)} | |
| 517 | + | } | |
| 518 | + | ||
| 519 | + | func (_c *MockFavoriteRepository_SetFolder_Call) Run(run func(ctx context.Context, id entity.FavoriteID, folderID *entity.FolderID)) *MockFavoriteRepository_SetFolder_Call { | |
| 520 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 521 | + | var arg0 context.Context | |
| 522 | + | if args[0] != nil { | |
| 523 | + | arg0 = args[0].(context.Context) | |
| 524 | + | } | |
| 525 | + | var arg1 entity.FavoriteID | |
| 526 | + | if args[1] != nil { | |
| 527 | + | arg1 = args[1].(entity.FavoriteID) | |
| 528 | + | } | |
| 529 | + | var arg2 *entity.FolderID | |
| 530 | + | if args[2] != nil { | |
| 531 | + | arg2 = args[2].(*entity.FolderID) | |
| 532 | + | } | |
| 533 | + | run( | |
| 534 | + | arg0, | |
| 535 | + | arg1, | |
| 536 | + | arg2, | |
| 537 | + | ) | |
| 538 | + | }) | |
| 539 | + | return _c | |
| 540 | + | } | |
| 541 | + | ||
| 542 | + | func (_c *MockFavoriteRepository_SetFolder_Call) Return(err error) *MockFavoriteRepository_SetFolder_Call { | |
| 543 | + | _c.Call.Return(err) | |
| 544 | + | return _c | |
| 545 | + | } | |
| 546 | + | ||
| 547 | + | func (_c *MockFavoriteRepository_SetFolder_Call) RunAndReturn(run func(ctx context.Context, id entity.FavoriteID, folderID *entity.FolderID) error) *MockFavoriteRepository_SetFolder_Call { | |
| 548 | + | _c.Call.Return(run) | |
| 549 | + | return _c | |
| 550 | + | } | |
| 551 | + | ||
| 552 | + | // SetShortcut provides a mock function for the type MockFavoriteRepository | |
| 553 | + | func (_mock *MockFavoriteRepository) SetShortcut(ctx context.Context, id entity.FavoriteID, key *int) error { | |
| 554 | + | ret := _mock.Called(ctx, id, key) | |
| 555 | + | ||
| 556 | + | if len(ret) == 0 { | |
| 557 | + | panic("no return value specified for SetShortcut") | |
| 558 | + | } | |
| 559 | + | ||
| 560 | + | var r0 error | |
| 561 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID, *int) error); ok { | |
| 562 | + | r0 = returnFunc(ctx, id, key) | |
| 563 | + | } else { | |
| 564 | + | r0 = ret.Error(0) | |
| 565 | + | } | |
| 566 | + | return r0 | |
| 567 | + | } | |
| 568 | + | ||
| 569 | + | // MockFavoriteRepository_SetShortcut_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetShortcut' | |
| 570 | + | type MockFavoriteRepository_SetShortcut_Call struct { | |
| 571 | + | *mock.Call | |
| 572 | + | } | |
| 573 | + | ||
| 574 | + | // SetShortcut is a helper method to define mock.On call | |
| 575 | + | // - ctx context.Context | |
| 576 | + | // - id entity.FavoriteID | |
| 577 | + | // - key *int | |
| 578 | + | func (_e *MockFavoriteRepository_Expecter) SetShortcut(ctx interface{}, id interface{}, key interface{}) *MockFavoriteRepository_SetShortcut_Call { | |
| 579 | + | return &MockFavoriteRepository_SetShortcut_Call{Call: _e.mock.On("SetShortcut", ctx, id, key)} | |
| 580 | + | } | |
| 581 | + | ||
| 582 | + | func (_c *MockFavoriteRepository_SetShortcut_Call) Run(run func(ctx context.Context, id entity.FavoriteID, key *int)) *MockFavoriteRepository_SetShortcut_Call { | |
| 583 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 584 | + | var arg0 context.Context | |
| 585 | + | if args[0] != nil { | |
| 586 | + | arg0 = args[0].(context.Context) | |
| 587 | + | } | |
| 588 | + | var arg1 entity.FavoriteID | |
| 589 | + | if args[1] != nil { | |
| 590 | + | arg1 = args[1].(entity.FavoriteID) | |
| 591 | + | } | |
| 592 | + | var arg2 *int | |
| 593 | + | if args[2] != nil { | |
| 594 | + | arg2 = args[2].(*int) | |
| 595 | + | } | |
| 596 | + | run( | |
| 597 | + | arg0, | |
| 598 | + | arg1, | |
| 599 | + | arg2, | |
| 600 | + | ) | |
| 601 | + | }) | |
| 602 | + | return _c | |
| 603 | + | } | |
| 604 | + | ||
| 605 | + | func (_c *MockFavoriteRepository_SetShortcut_Call) Return(err error) *MockFavoriteRepository_SetShortcut_Call { | |
| 606 | + | _c.Call.Return(err) | |
| 607 | + | return _c | |
| 608 | + | } | |
| 609 | + | ||
| 610 | + | func (_c *MockFavoriteRepository_SetShortcut_Call) RunAndReturn(run func(ctx context.Context, id entity.FavoriteID, key *int) error) *MockFavoriteRepository_SetShortcut_Call { | |
| 611 | + | _c.Call.Return(run) | |
| 612 | + | return _c | |
| 613 | + | } | |
| 614 | + | ||
| 615 | + | // UpdatePosition provides a mock function for the type MockFavoriteRepository | |
| 616 | + | func (_mock *MockFavoriteRepository) UpdatePosition(ctx context.Context, id entity.FavoriteID, position int) error { | |
| 617 | + | ret := _mock.Called(ctx, id, position) | |
| 618 | + | ||
| 619 | + | if len(ret) == 0 { | |
| 620 | + | panic("no return value specified for UpdatePosition") | |
| 621 | + | } | |
| 622 | + | ||
| 623 | + | var r0 error | |
| 624 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID, int) error); ok { | |
| 625 | + | r0 = returnFunc(ctx, id, position) | |
| 626 | + | } else { | |
| 627 | + | r0 = ret.Error(0) | |
| 628 | + | } | |
| 629 | + | return r0 | |
| 630 | + | } | |
| 631 | + | ||
| 632 | + | // MockFavoriteRepository_UpdatePosition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePosition' | |
| 633 | + | type MockFavoriteRepository_UpdatePosition_Call struct { | |
| 634 | + | *mock.Call | |
| 635 | + | } | |
| 636 | + | ||
| 637 | + | // UpdatePosition is a helper method to define mock.On call | |
| 638 | + | // - ctx context.Context | |
| 639 | + | // - id entity.FavoriteID | |
| 640 | + | // - position int | |
| 641 | + | func (_e *MockFavoriteRepository_Expecter) UpdatePosition(ctx interface{}, id interface{}, position interface{}) *MockFavoriteRepository_UpdatePosition_Call { | |
| 642 | + | return &MockFavoriteRepository_UpdatePosition_Call{Call: _e.mock.On("UpdatePosition", ctx, id, position)} | |
| 643 | + | } | |
| 644 | + | ||
| 645 | + | func (_c *MockFavoriteRepository_UpdatePosition_Call) Run(run func(ctx context.Context, id entity.FavoriteID, position int)) *MockFavoriteRepository_UpdatePosition_Call { | |
| 646 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 647 | + | var arg0 context.Context | |
| 648 | + | if args[0] != nil { | |
| 649 | + | arg0 = args[0].(context.Context) | |
| 650 | + | } | |
| 651 | + | var arg1 entity.FavoriteID | |
| 652 | + | if args[1] != nil { | |
| 653 | + | arg1 = args[1].(entity.FavoriteID) | |
| 654 | + | } | |
| 655 | + | var arg2 int | |
| 656 | + | if args[2] != nil { | |
| 657 | + | arg2 = args[2].(int) | |
| 658 | + | } | |
| 659 | + | run( | |
| 660 | + | arg0, | |
| 661 | + | arg1, | |
| 662 | + | arg2, | |
| 663 | + | ) | |
| 664 | + | }) | |
| 665 | + | return _c | |
| 666 | + | } | |
| 667 | + | ||
| 668 | + | func (_c *MockFavoriteRepository_UpdatePosition_Call) Return(err error) *MockFavoriteRepository_UpdatePosition_Call { | |
| 669 | + | _c.Call.Return(err) | |
| 670 | + | return _c | |
| 671 | + | } | |
| 672 | + | ||
| 673 | + | func (_c *MockFavoriteRepository_UpdatePosition_Call) RunAndReturn(run func(ctx context.Context, id entity.FavoriteID, position int) error) *MockFavoriteRepository_UpdatePosition_Call { | |
| 674 | + | _c.Call.Return(run) | |
| 675 | + | return _c | |
| 676 | + | } | |
| @@ -0,0 +1,676 @@ | |||||
| 1 | + | // Code generated by mockery; DO NOT EDIT. | |||
| 2 | + | // github.com/vektra/mockery | |||
| 3 | + | // template: testify | |||
| 4 | + | ||||
| 5 | + | package mocks | |||
| 6 | + | ||||
| 7 | + | import ( | |||
| 8 | + | "context" | |||
| 9 | + | ||||
| 10 | + | "github.com/bnema/dumber/internal/domain/entity" | |||
| 11 | + | mock "github.com/stretchr/testify/mock" | |||
| 12 | + | ) | |||
| 13 | + | ||||
| 14 | + | // NewMockFavoriteRepository creates a new instance of MockFavoriteRepository. 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. | |||
| 16 | + | func NewMockFavoriteRepository(t interface { | |||
| 17 | + | mock.TestingT | |||
| 18 | + | Cleanup(func()) | |||
| 19 | + | }) *MockFavoriteRepository { | |||
| 20 | + | mock := &MockFavoriteRepository{} | |||
| 21 | + | mock.Mock.Test(t) | |||
| 22 | + | ||||
| 23 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |||
| 24 | + | ||||
| 25 | + | return mock | |||
| 26 | + | } | |||
| 27 | + | ||||
| 28 | + | // MockFavoriteRepository is an autogenerated mock type for the FavoriteRepository type | |||
| 29 | + | type MockFavoriteRepository struct { | |||
| 30 | + | mock.Mock | |||
| 31 | + | } | |||
| 32 | + | ||||
| 33 | + | type MockFavoriteRepository_Expecter struct { | |||
| 34 | + | mock *mock.Mock | |||
| 35 | + | } | |||
| 36 | + | ||||
| 37 | + | func (_m *MockFavoriteRepository) EXPECT() *MockFavoriteRepository_Expecter { | |||
| 38 | + | return &MockFavoriteRepository_Expecter{mock: &_m.Mock} | |||
| 39 | + | } | |||
| 40 | + | ||||
| 41 | + | // Delete provides a mock function for the type MockFavoriteRepository | |||
| 42 | + | func (_mock *MockFavoriteRepository) Delete(ctx context.Context, id entity.FavoriteID) error { | |||
| 43 | + | ret := _mock.Called(ctx, id) | |||
| 44 | + | ||||
| 45 | + | if len(ret) == 0 { | |||
| 46 | + | panic("no return value specified for Delete") | |||
| 47 | + | } | |||
| 48 | + | ||||
| 49 | + | var r0 error | |||
| 50 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) error); ok { | |||
| 51 | + | r0 = returnFunc(ctx, id) | |||
| 52 | + | } else { | |||
| 53 | + | r0 = ret.Error(0) | |||
| 54 | + | } | |||
| 55 | + | return r0 | |||
| 56 | + | } | |||
| 57 | + | ||||
| 58 | + | // MockFavoriteRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' | |||
| 59 | + | type MockFavoriteRepository_Delete_Call struct { | |||
| 60 | + | *mock.Call | |||
| 61 | + | } | |||
| 62 | + | ||||
| 63 | + | // Delete is a helper method to define mock.On call | |||
| 64 | + | // - ctx context.Context | |||
| 65 | + | // - id entity.FavoriteID | |||
| 66 | + | func (_e *MockFavoriteRepository_Expecter) Delete(ctx interface{}, id interface{}) *MockFavoriteRepository_Delete_Call { | |||
| 67 | + | return &MockFavoriteRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} | |||
| 68 | + | } | |||
| 69 | + | ||||
| 70 | + | func (_c *MockFavoriteRepository_Delete_Call) Run(run func(ctx context.Context, id entity.FavoriteID)) *MockFavoriteRepository_Delete_Call { | |||
| 71 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 72 | + | var arg0 context.Context | |||
| 73 | + | if args[0] != nil { | |||
| 74 | + | arg0 = args[0].(context.Context) | |||
| 75 | + | } | |||
| 76 | + | var arg1 entity.FavoriteID | |||
| 77 | + | if args[1] != nil { | |||
| 78 | + | arg1 = args[1].(entity.FavoriteID) | |||
| 79 | + | } | |||
| 80 | + | run( | |||
| 81 | + | arg0, | |||
| 82 | + | arg1, | |||
| 83 | + | ) | |||
| 84 | + | }) | |||
| 85 | + | return _c | |||
| 86 | + | } | |||
| 87 | + | ||||
| 88 | + | func (_c *MockFavoriteRepository_Delete_Call) Return(err error) *MockFavoriteRepository_Delete_Call { | |||
| 89 | + | _c.Call.Return(err) | |||
| 90 | + | return _c | |||
| 91 | + | } | |||
| 92 | + | ||||
| 93 | + | func (_c *MockFavoriteRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, id entity.FavoriteID) error) *MockFavoriteRepository_Delete_Call { | |||
| 94 | + | _c.Call.Return(run) | |||
| 95 | + | return _c | |||
| 96 | + | } | |||
| 97 | + | ||||
| 98 | + | // FindByID provides a mock function for the type MockFavoriteRepository | |||
| 99 | + | func (_mock *MockFavoriteRepository) FindByID(ctx context.Context, id entity.FavoriteID) (*entity.Favorite, error) { | |||
| 100 | + | ret := _mock.Called(ctx, id) | |||
| 101 | + | ||||
| 102 | + | if len(ret) == 0 { | |||
| 103 | + | panic("no return value specified for FindByID") | |||
| 104 | + | } | |||
| 105 | + | ||||
| 106 | + | var r0 *entity.Favorite | |||
| 107 | + | var r1 error | |||
| 108 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) (*entity.Favorite, error)); ok { | |||
| 109 | + | return returnFunc(ctx, id) | |||
| 110 | + | } | |||
| 111 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) *entity.Favorite); ok { | |||
| 112 | + | r0 = returnFunc(ctx, id) | |||
| 113 | + | } else { | |||
| 114 | + | if ret.Get(0) != nil { | |||
| 115 | + | r0 = ret.Get(0).(*entity.Favorite) | |||
| 116 | + | } | |||
| 117 | + | } | |||
| 118 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, entity.FavoriteID) error); ok { | |||
| 119 | + | r1 = returnFunc(ctx, id) | |||
| 120 | + | } else { | |||
| 121 | + | r1 = ret.Error(1) | |||
| 122 | + | } | |||
| 123 | + | return r0, r1 | |||
| 124 | + | } | |||
| 125 | + | ||||
| 126 | + | // MockFavoriteRepository_FindByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByID' | |||
| 127 | + | type MockFavoriteRepository_FindByID_Call struct { | |||
| 128 | + | *mock.Call | |||
| 129 | + | } | |||
| 130 | + | ||||
| 131 | + | // FindByID is a helper method to define mock.On call | |||
| 132 | + | // - ctx context.Context | |||
| 133 | + | // - id entity.FavoriteID | |||
| 134 | + | func (_e *MockFavoriteRepository_Expecter) FindByID(ctx interface{}, id interface{}) *MockFavoriteRepository_FindByID_Call { | |||
| 135 | + | return &MockFavoriteRepository_FindByID_Call{Call: _e.mock.On("FindByID", ctx, id)} | |||
| 136 | + | } | |||
| 137 | + | ||||
| 138 | + | func (_c *MockFavoriteRepository_FindByID_Call) Run(run func(ctx context.Context, id entity.FavoriteID)) *MockFavoriteRepository_FindByID_Call { | |||
| 139 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 140 | + | var arg0 context.Context | |||
| 141 | + | if args[0] != nil { | |||
| 142 | + | arg0 = args[0].(context.Context) | |||
| 143 | + | } | |||
| 144 | + | var arg1 entity.FavoriteID | |||
| 145 | + | if args[1] != nil { | |||
| 146 | + | arg1 = args[1].(entity.FavoriteID) | |||
| 147 | + | } | |||
| 148 | + | run( | |||
| 149 | + | arg0, | |||
| 150 | + | arg1, | |||
| 151 | + | ) | |||
| 152 | + | }) | |||
| 153 | + | return _c | |||
| 154 | + | } | |||
| 155 | + | ||||
| 156 | + | func (_c *MockFavoriteRepository_FindByID_Call) Return(favorite *entity.Favorite, err error) *MockFavoriteRepository_FindByID_Call { | |||
| 157 | + | _c.Call.Return(favorite, err) | |||
| 158 | + | return _c | |||
| 159 | + | } | |||
| 160 | + | ||||
| 161 | + | func (_c *MockFavoriteRepository_FindByID_Call) RunAndReturn(run func(ctx context.Context, id entity.FavoriteID) (*entity.Favorite, error)) *MockFavoriteRepository_FindByID_Call { | |||
| 162 | + | _c.Call.Return(run) | |||
| 163 | + | return _c | |||
| 164 | + | } | |||
| 165 | + | ||||
| 166 | + | // FindByURL provides a mock function for the type MockFavoriteRepository | |||
| 167 | + | func (_mock *MockFavoriteRepository) FindByURL(ctx context.Context, url string) (*entity.Favorite, error) { | |||
| 168 | + | ret := _mock.Called(ctx, url) | |||
| 169 | + | ||||
| 170 | + | if len(ret) == 0 { | |||
| 171 | + | panic("no return value specified for FindByURL") | |||
| 172 | + | } | |||
| 173 | + | ||||
| 174 | + | var r0 *entity.Favorite | |||
| 175 | + | var r1 error | |||
| 176 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*entity.Favorite, error)); ok { | |||
| 177 | + | return returnFunc(ctx, url) | |||
| 178 | + | } | |||
| 179 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) *entity.Favorite); ok { | |||
| 180 | + | r0 = returnFunc(ctx, url) | |||
| 181 | + | } else { | |||
| 182 | + | if ret.Get(0) != nil { | |||
| 183 | + | r0 = ret.Get(0).(*entity.Favorite) | |||
| 184 | + | } | |||
| 185 | + | } | |||
| 186 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { | |||
| 187 | + | r1 = returnFunc(ctx, url) | |||
| 188 | + | } else { | |||
| 189 | + | r1 = ret.Error(1) | |||
| 190 | + | } | |||
| 191 | + | return r0, r1 | |||
| 192 | + | } | |||
| 193 | + | ||||
| 194 | + | // MockFavoriteRepository_FindByURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByURL' | |||
| 195 | + | type MockFavoriteRepository_FindByURL_Call struct { | |||
| 196 | + | *mock.Call | |||
| 197 | + | } | |||
| 198 | + | ||||
| 199 | + | // FindByURL is a helper method to define mock.On call | |||
| 200 | + | // - ctx context.Context | |||
| 201 | + | // - url string | |||
| 202 | + | func (_e *MockFavoriteRepository_Expecter) FindByURL(ctx interface{}, url interface{}) *MockFavoriteRepository_FindByURL_Call { | |||
| 203 | + | return &MockFavoriteRepository_FindByURL_Call{Call: _e.mock.On("FindByURL", ctx, url)} | |||
| 204 | + | } | |||
| 205 | + | ||||
| 206 | + | func (_c *MockFavoriteRepository_FindByURL_Call) Run(run func(ctx context.Context, url string)) *MockFavoriteRepository_FindByURL_Call { | |||
| 207 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 208 | + | var arg0 context.Context | |||
| 209 | + | if args[0] != nil { | |||
| 210 | + | arg0 = args[0].(context.Context) | |||
| 211 | + | } | |||
| 212 | + | var arg1 string | |||
| 213 | + | if args[1] != nil { | |||
| 214 | + | arg1 = args[1].(string) | |||
| 215 | + | } | |||
| 216 | + | run( | |||
| 217 | + | arg0, | |||
| 218 | + | arg1, | |||
| 219 | + | ) | |||
| 220 | + | }) | |||
| 221 | + | return _c | |||
| 222 | + | } | |||
| 223 | + | ||||
| 224 | + | func (_c *MockFavoriteRepository_FindByURL_Call) Return(favorite *entity.Favorite, err error) *MockFavoriteRepository_FindByURL_Call { | |||
| 225 | + | _c.Call.Return(favorite, err) | |||
| 226 | + | return _c | |||
| 227 | + | } | |||
| 228 | + | ||||
| 229 | + | func (_c *MockFavoriteRepository_FindByURL_Call) RunAndReturn(run func(ctx context.Context, url string) (*entity.Favorite, error)) *MockFavoriteRepository_FindByURL_Call { | |||
| 230 | + | _c.Call.Return(run) | |||
| 231 | + | return _c | |||
| 232 | + | } | |||
| 233 | + | ||||
| 234 | + | // GetAll provides a mock function for the type MockFavoriteRepository | |||
| 235 | + | func (_mock *MockFavoriteRepository) GetAll(ctx context.Context) ([]*entity.Favorite, error) { | |||
| 236 | + | ret := _mock.Called(ctx) | |||
| 237 | + | ||||
| 238 | + | if len(ret) == 0 { | |||
| 239 | + | panic("no return value specified for GetAll") | |||
| 240 | + | } | |||
| 241 | + | ||||
| 242 | + | var r0 []*entity.Favorite | |||
| 243 | + | var r1 error | |||
| 244 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.Favorite, error)); ok { | |||
| 245 | + | return returnFunc(ctx) | |||
| 246 | + | } | |||
| 247 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.Favorite); ok { | |||
| 248 | + | r0 = returnFunc(ctx) | |||
| 249 | + | } else { | |||
| 250 | + | if ret.Get(0) != nil { | |||
| 251 | + | r0 = ret.Get(0).([]*entity.Favorite) | |||
| 252 | + | } | |||
| 253 | + | } | |||
| 254 | + | if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { | |||
| 255 | + | r1 = returnFunc(ctx) | |||
| 256 | + | } else { | |||
| 257 | + | r1 = ret.Error(1) | |||
| 258 | + | } | |||
| 259 | + | return r0, r1 | |||
| 260 | + | } | |||
| 261 | + | ||||
| 262 | + | // MockFavoriteRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' | |||
| 263 | + | type MockFavoriteRepository_GetAll_Call struct { | |||
| 264 | + | *mock.Call | |||
| 265 | + | } | |||
| 266 | + | ||||
| 267 | + | // GetAll is a helper method to define mock.On call | |||
| 268 | + | // - ctx context.Context | |||
| 269 | + | func (_e *MockFavoriteRepository_Expecter) GetAll(ctx interface{}) *MockFavoriteRepository_GetAll_Call { | |||
| 270 | + | return &MockFavoriteRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx)} | |||
| 271 | + | } | |||
| 272 | + | ||||
| 273 | + | func (_c *MockFavoriteRepository_GetAll_Call) Run(run func(ctx context.Context)) *MockFavoriteRepository_GetAll_Call { | |||
| 274 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 275 | + | var arg0 context.Context | |||
| 276 | + | if args[0] != nil { | |||
| 277 | + | arg0 = args[0].(context.Context) | |||
| 278 | + | } | |||
| 279 | + | run( | |||
| 280 | + | arg0, | |||
| 281 | + | ) | |||
| 282 | + | }) | |||
| 283 | + | return _c | |||
| 284 | + | } | |||
| 285 | + | ||||
| 286 | + | func (_c *MockFavoriteRepository_GetAll_Call) Return(favorites []*entity.Favorite, err error) *MockFavoriteRepository_GetAll_Call { | |||
| 287 | + | _c.Call.Return(favorites, err) | |||
| 288 | + | return _c | |||
| 289 | + | } | |||
| 290 | + | ||||
| 291 | + | func (_c *MockFavoriteRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.Favorite, error)) *MockFavoriteRepository_GetAll_Call { | |||
| 292 | + | _c.Call.Return(run) | |||
| 293 | + | return _c | |||
| 294 | + | } | |||
| 295 | + | ||||
| 296 | + | // GetByFolder provides a mock function for the type MockFavoriteRepository | |||
| 297 | + | func (_mock *MockFavoriteRepository) GetByFolder(ctx context.Context, folderID *entity.FolderID) ([]*entity.Favorite, error) { | |||
| 298 | + | ret := _mock.Called(ctx, folderID) | |||
| 299 | + | ||||
| 300 | + | if len(ret) == 0 { | |||
| 301 | + | panic("no return value specified for GetByFolder") | |||
| 302 | + | } | |||
| 303 | + | ||||
| 304 | + | var r0 []*entity.Favorite | |||
| 305 | + | var r1 error | |||
| 306 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.FolderID) ([]*entity.Favorite, error)); ok { | |||
| 307 | + | return returnFunc(ctx, folderID) | |||
| 308 | + | } | |||
| 309 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.FolderID) []*entity.Favorite); ok { | |||
| 310 | + | r0 = returnFunc(ctx, folderID) | |||
| 311 | + | } else { | |||
| 312 | + | if ret.Get(0) != nil { | |||
| 313 | + | r0 = ret.Get(0).([]*entity.Favorite) | |||
| 314 | + | } | |||
| 315 | + | } | |||
| 316 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, *entity.FolderID) error); ok { | |||
| 317 | + | r1 = returnFunc(ctx, folderID) | |||
| 318 | + | } else { | |||
| 319 | + | r1 = ret.Error(1) | |||
| 320 | + | } | |||
| 321 | + | return r0, r1 | |||
| 322 | + | } | |||
| 323 | + | ||||
| 324 | + | // MockFavoriteRepository_GetByFolder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByFolder' | |||
| 325 | + | type MockFavoriteRepository_GetByFolder_Call struct { | |||
| 326 | + | *mock.Call | |||
| 327 | + | } | |||
| 328 | + | ||||
| 329 | + | // GetByFolder is a helper method to define mock.On call | |||
| 330 | + | // - ctx context.Context | |||
| 331 | + | // - folderID *entity.FolderID | |||
| 332 | + | func (_e *MockFavoriteRepository_Expecter) GetByFolder(ctx interface{}, folderID interface{}) *MockFavoriteRepository_GetByFolder_Call { | |||
| 333 | + | return &MockFavoriteRepository_GetByFolder_Call{Call: _e.mock.On("GetByFolder", ctx, folderID)} | |||
| 334 | + | } | |||
| 335 | + | ||||
| 336 | + | func (_c *MockFavoriteRepository_GetByFolder_Call) Run(run func(ctx context.Context, folderID *entity.FolderID)) *MockFavoriteRepository_GetByFolder_Call { | |||
| 337 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 338 | + | var arg0 context.Context | |||
| 339 | + | if args[0] != nil { | |||
| 340 | + | arg0 = args[0].(context.Context) | |||
| 341 | + | } | |||
| 342 | + | var arg1 *entity.FolderID | |||
| 343 | + | if args[1] != nil { | |||
| 344 | + | arg1 = args[1].(*entity.FolderID) | |||
| 345 | + | } | |||
| 346 | + | run( | |||
| 347 | + | arg0, | |||
| 348 | + | arg1, | |||
| 349 | + | ) | |||
| 350 | + | }) | |||
| 351 | + | return _c | |||
| 352 | + | } | |||
| 353 | + | ||||
| 354 | + | func (_c *MockFavoriteRepository_GetByFolder_Call) Return(favorites []*entity.Favorite, err error) *MockFavoriteRepository_GetByFolder_Call { | |||
| 355 | + | _c.Call.Return(favorites, err) | |||
| 356 | + | return _c | |||
| 357 | + | } | |||
| 358 | + | ||||
| 359 | + | func (_c *MockFavoriteRepository_GetByFolder_Call) RunAndReturn(run func(ctx context.Context, folderID *entity.FolderID) ([]*entity.Favorite, error)) *MockFavoriteRepository_GetByFolder_Call { | |||
| 360 | + | _c.Call.Return(run) | |||
| 361 | + | return _c | |||
| 362 | + | } | |||
| 363 | + | ||||
| 364 | + | // GetByShortcut provides a mock function for the type MockFavoriteRepository | |||
| 365 | + | func (_mock *MockFavoriteRepository) GetByShortcut(ctx context.Context, key int) (*entity.Favorite, error) { | |||
| 366 | + | ret := _mock.Called(ctx, key) | |||
| 367 | + | ||||
| 368 | + | if len(ret) == 0 { | |||
| 369 | + | panic("no return value specified for GetByShortcut") | |||
| 370 | + | } | |||
| 371 | + | ||||
| 372 | + | var r0 *entity.Favorite | |||
| 373 | + | var r1 error | |||
| 374 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, int) (*entity.Favorite, error)); ok { | |||
| 375 | + | return returnFunc(ctx, key) | |||
| 376 | + | } | |||
| 377 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, int) *entity.Favorite); ok { | |||
| 378 | + | r0 = returnFunc(ctx, key) | |||
| 379 | + | } else { | |||
| 380 | + | if ret.Get(0) != nil { | |||
| 381 | + | r0 = ret.Get(0).(*entity.Favorite) | |||
| 382 | + | } | |||
| 383 | + | } | |||
| 384 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, int) error); ok { | |||
| 385 | + | r1 = returnFunc(ctx, key) | |||
| 386 | + | } else { | |||
| 387 | + | r1 = ret.Error(1) | |||
| 388 | + | } | |||
| 389 | + | return r0, r1 | |||
| 390 | + | } | |||
| 391 | + | ||||
| 392 | + | // MockFavoriteRepository_GetByShortcut_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByShortcut' | |||
| 393 | + | type MockFavoriteRepository_GetByShortcut_Call struct { | |||
| 394 | + | *mock.Call | |||
| 395 | + | } | |||
| 396 | + | ||||
| 397 | + | // GetByShortcut is a helper method to define mock.On call | |||
| 398 | + | // - ctx context.Context | |||
| 399 | + | // - key int | |||
| 400 | + | func (_e *MockFavoriteRepository_Expecter) GetByShortcut(ctx interface{}, key interface{}) *MockFavoriteRepository_GetByShortcut_Call { | |||
| 401 | + | return &MockFavoriteRepository_GetByShortcut_Call{Call: _e.mock.On("GetByShortcut", ctx, key)} | |||
| 402 | + | } | |||
| 403 | + | ||||
| 404 | + | func (_c *MockFavoriteRepository_GetByShortcut_Call) Run(run func(ctx context.Context, key int)) *MockFavoriteRepository_GetByShortcut_Call { | |||
| 405 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 406 | + | var arg0 context.Context | |||
| 407 | + | if args[0] != nil { | |||
| 408 | + | arg0 = args[0].(context.Context) | |||
| 409 | + | } | |||
| 410 | + | var arg1 int | |||
| 411 | + | if args[1] != nil { | |||
| 412 | + | arg1 = args[1].(int) | |||
| 413 | + | } | |||
| 414 | + | run( | |||
| 415 | + | arg0, | |||
| 416 | + | arg1, | |||
| 417 | + | ) | |||
| 418 | + | }) | |||
| 419 | + | return _c | |||
| 420 | + | } | |||
| 421 | + | ||||
| 422 | + | func (_c *MockFavoriteRepository_GetByShortcut_Call) Return(favorite *entity.Favorite, err error) *MockFavoriteRepository_GetByShortcut_Call { | |||
| 423 | + | _c.Call.Return(favorite, err) | |||
| 424 | + | return _c | |||
| 425 | + | } | |||
| 426 | + | ||||
| 427 | + | func (_c *MockFavoriteRepository_GetByShortcut_Call) RunAndReturn(run func(ctx context.Context, key int) (*entity.Favorite, error)) *MockFavoriteRepository_GetByShortcut_Call { | |||
| 428 | + | _c.Call.Return(run) | |||
| 429 | + | return _c | |||
| 430 | + | } | |||
| 431 | + | ||||
| 432 | + | // Save provides a mock function for the type MockFavoriteRepository | |||
| 433 | + | func (_mock *MockFavoriteRepository) Save(ctx context.Context, fav *entity.Favorite) error { | |||
| 434 | + | ret := _mock.Called(ctx, fav) | |||
| 435 | + | ||||
| 436 | + | if len(ret) == 0 { | |||
| 437 | + | panic("no return value specified for Save") | |||
| 438 | + | } | |||
| 439 | + | ||||
| 440 | + | var r0 error | |||
| 441 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.Favorite) error); ok { | |||
| 442 | + | r0 = returnFunc(ctx, fav) | |||
| 443 | + | } else { | |||
| 444 | + | r0 = ret.Error(0) | |||
| 445 | + | } | |||
| 446 | + | return r0 | |||
| 447 | + | } | |||
| 448 | + | ||||
| 449 | + | // MockFavoriteRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' | |||
| 450 | + | type MockFavoriteRepository_Save_Call struct { | |||
| 451 | + | *mock.Call | |||
| 452 | + | } | |||
| 453 | + | ||||
| 454 | + | // Save is a helper method to define mock.On call | |||
| 455 | + | // - ctx context.Context | |||
| 456 | + | // - fav *entity.Favorite | |||
| 457 | + | func (_e *MockFavoriteRepository_Expecter) Save(ctx interface{}, fav interface{}) *MockFavoriteRepository_Save_Call { | |||
| 458 | + | return &MockFavoriteRepository_Save_Call{Call: _e.mock.On("Save", ctx, fav)} | |||
| 459 | + | } | |||
| 460 | + | ||||
| 461 | + | func (_c *MockFavoriteRepository_Save_Call) Run(run func(ctx context.Context, fav *entity.Favorite)) *MockFavoriteRepository_Save_Call { | |||
| 462 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 463 | + | var arg0 context.Context | |||
| 464 | + | if args[0] != nil { | |||
| 465 | + | arg0 = args[0].(context.Context) | |||
| 466 | + | } | |||
| 467 | + | var arg1 *entity.Favorite | |||
| 468 | + | if args[1] != nil { | |||
| 469 | + | arg1 = args[1].(*entity.Favorite) | |||
| 470 | + | } | |||
| 471 | + | run( | |||
| 472 | + | arg0, | |||
| 473 | + | arg1, | |||
| 474 | + | ) | |||
| 475 | + | }) | |||
| 476 | + | return _c | |||
| 477 | + | } | |||
| 478 | + | ||||
| 479 | + | func (_c *MockFavoriteRepository_Save_Call) Return(err error) *MockFavoriteRepository_Save_Call { | |||
| 480 | + | _c.Call.Return(err) | |||
| 481 | + | return _c | |||
| 482 | + | } | |||
| 483 | + | ||||
| 484 | + | func (_c *MockFavoriteRepository_Save_Call) RunAndReturn(run func(ctx context.Context, fav *entity.Favorite) error) *MockFavoriteRepository_Save_Call { | |||
| 485 | + | _c.Call.Return(run) | |||
| 486 | + | return _c | |||
| 487 | + | } | |||
| 488 | + | ||||
| 489 | + | // SetFolder provides a mock function for the type MockFavoriteRepository | |||
| 490 | + | func (_mock *MockFavoriteRepository) SetFolder(ctx context.Context, id entity.FavoriteID, folderID *entity.FolderID) error { | |||
| 491 | + | ret := _mock.Called(ctx, id, folderID) | |||
| 492 | + | ||||
| 493 | + | if len(ret) == 0 { | |||
| 494 | + | panic("no return value specified for SetFolder") | |||
| 495 | + | } | |||
| 496 | + | ||||
| 497 | + | var r0 error | |||
| 498 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID, *entity.FolderID) error); ok { | |||
| 499 | + | r0 = returnFunc(ctx, id, folderID) | |||
| 500 | + | } else { | |||
| 501 | + | r0 = ret.Error(0) | |||
| 502 | + | } | |||
| 503 | + | return r0 | |||
| 504 | + | } | |||
| 505 | + | ||||
| 506 | + | // MockFavoriteRepository_SetFolder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetFolder' | |||
| 507 | + | type MockFavoriteRepository_SetFolder_Call struct { | |||
| 508 | + | *mock.Call | |||
| 509 | + | } | |||
| 510 | + | ||||
| 511 | + | // SetFolder is a helper method to define mock.On call | |||
| 512 | + | // - ctx context.Context | |||
| 513 | + | // - id entity.FavoriteID | |||
| 514 | + | // - folderID *entity.FolderID | |||
| 515 | + | func (_e *MockFavoriteRepository_Expecter) SetFolder(ctx interface{}, id interface{}, folderID interface{}) *MockFavoriteRepository_SetFolder_Call { | |||
| 516 | + | return &MockFavoriteRepository_SetFolder_Call{Call: _e.mock.On("SetFolder", ctx, id, folderID)} | |||
| 517 | + | } | |||
| 518 | + | ||||
| 519 | + | func (_c *MockFavoriteRepository_SetFolder_Call) Run(run func(ctx context.Context, id entity.FavoriteID, folderID *entity.FolderID)) *MockFavoriteRepository_SetFolder_Call { | |||
| 520 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 521 | + | var arg0 context.Context | |||
| 522 | + | if args[0] != nil { | |||
| 523 | + | arg0 = args[0].(context.Context) | |||
| 524 | + | } | |||
| 525 | + | var arg1 entity.FavoriteID | |||
| 526 | + | if args[1] != nil { | |||
| 527 | + | arg1 = args[1].(entity.FavoriteID) | |||
| 528 | + | } | |||
| 529 | + | var arg2 *entity.FolderID | |||
| 530 | + | if args[2] != nil { | |||
| 531 | + | arg2 = args[2].(*entity.FolderID) | |||
| 532 | + | } | |||
| 533 | + | run( | |||
| 534 | + | arg0, | |||
| 535 | + | arg1, | |||
| 536 | + | arg2, | |||
| 537 | + | ) | |||
| 538 | + | }) | |||
| 539 | + | return _c | |||
| 540 | + | } | |||
| 541 | + | ||||
| 542 | + | func (_c *MockFavoriteRepository_SetFolder_Call) Return(err error) *MockFavoriteRepository_SetFolder_Call { | |||
| 543 | + | _c.Call.Return(err) | |||
| 544 | + | return _c | |||
| 545 | + | } | |||
| 546 | + | ||||
| 547 | + | func (_c *MockFavoriteRepository_SetFolder_Call) RunAndReturn(run func(ctx context.Context, id entity.FavoriteID, folderID *entity.FolderID) error) *MockFavoriteRepository_SetFolder_Call { | |||
| 548 | + | _c.Call.Return(run) | |||
| 549 | + | return _c | |||
| 550 | + | } | |||
| 551 | + | ||||
| 552 | + | // SetShortcut provides a mock function for the type MockFavoriteRepository | |||
| 553 | + | func (_mock *MockFavoriteRepository) SetShortcut(ctx context.Context, id entity.FavoriteID, key *int) error { | |||
| 554 | + | ret := _mock.Called(ctx, id, key) | |||
| 555 | + | ||||
| 556 | + | if len(ret) == 0 { | |||
| 557 | + | panic("no return value specified for SetShortcut") | |||
| 558 | + | } | |||
| 559 | + | ||||
| 560 | + | var r0 error | |||
| 561 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID, *int) error); ok { | |||
| 562 | + | r0 = returnFunc(ctx, id, key) | |||
| 563 | + | } else { | |||
| 564 | + | r0 = ret.Error(0) | |||
| 565 | + | } | |||
| 566 | + | return r0 | |||
| 567 | + | } | |||
| 568 | + | ||||
| 569 | + | // MockFavoriteRepository_SetShortcut_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetShortcut' | |||
| 570 | + | type MockFavoriteRepository_SetShortcut_Call struct { | |||
| 571 | + | *mock.Call | |||
| 572 | + | } | |||
| 573 | + | ||||
| 574 | + | // SetShortcut is a helper method to define mock.On call | |||
| 575 | + | // - ctx context.Context | |||
| 576 | + | // - id entity.FavoriteID | |||
| 577 | + | // - key *int | |||
| 578 | + | func (_e *MockFavoriteRepository_Expecter) SetShortcut(ctx interface{}, id interface{}, key interface{}) *MockFavoriteRepository_SetShortcut_Call { | |||
| 579 | + | return &MockFavoriteRepository_SetShortcut_Call{Call: _e.mock.On("SetShortcut", ctx, id, key)} | |||
| 580 | + | } | |||
| 581 | + | ||||
| 582 | + | func (_c *MockFavoriteRepository_SetShortcut_Call) Run(run func(ctx context.Context, id entity.FavoriteID, key *int)) *MockFavoriteRepository_SetShortcut_Call { | |||
| 583 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 584 | + | var arg0 context.Context | |||
| 585 | + | if args[0] != nil { | |||
| 586 | + | arg0 = args[0].(context.Context) | |||
| 587 | + | } | |||
| 588 | + | var arg1 entity.FavoriteID | |||
| 589 | + | if args[1] != nil { | |||
| 590 | + | arg1 = args[1].(entity.FavoriteID) | |||
| 591 | + | } | |||
| 592 | + | var arg2 *int | |||
| 593 | + | if args[2] != nil { | |||
| 594 | + | arg2 = args[2].(*int) | |||
| 595 | + | } | |||
| 596 | + | run( | |||
| 597 | + | arg0, | |||
| 598 | + | arg1, | |||
| 599 | + | arg2, | |||
| 600 | + | ) | |||
| 601 | + | }) | |||
| 602 | + | return _c | |||
| 603 | + | } | |||
| 604 | + | ||||
| 605 | + | func (_c *MockFavoriteRepository_SetShortcut_Call) Return(err error) *MockFavoriteRepository_SetShortcut_Call { | |||
| 606 | + | _c.Call.Return(err) | |||
| 607 | + | return _c | |||
| 608 | + | } | |||
| 609 | + | ||||
| 610 | + | func (_c *MockFavoriteRepository_SetShortcut_Call) RunAndReturn(run func(ctx context.Context, id entity.FavoriteID, key *int) error) *MockFavoriteRepository_SetShortcut_Call { | |||
| 611 | + | _c.Call.Return(run) | |||
| 612 | + | return _c | |||
| 613 | + | } | |||
| 614 | + | ||||
| 615 | + | // UpdatePosition provides a mock function for the type MockFavoriteRepository | |||
| 616 | + | func (_mock *MockFavoriteRepository) UpdatePosition(ctx context.Context, id entity.FavoriteID, position int) error { | |||
| 617 | + | ret := _mock.Called(ctx, id, position) | |||
| 618 | + | ||||
| 619 | + | if len(ret) == 0 { | |||
| 620 | + | panic("no return value specified for UpdatePosition") | |||
| 621 | + | } | |||
| 622 | + | ||||
| 623 | + | var r0 error | |||
| 624 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID, int) error); ok { | |||
| 625 | + | r0 = returnFunc(ctx, id, position) | |||
| 626 | + | } else { | |||
| 627 | + | r0 = ret.Error(0) | |||
| 628 | + | } | |||
| 629 | + | return r0 | |||
| 630 | + | } | |||
| 631 | + | ||||
| 632 | + | // MockFavoriteRepository_UpdatePosition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePosition' | |||
| 633 | + | type MockFavoriteRepository_UpdatePosition_Call struct { | |||
| 634 | + | *mock.Call | |||
| 635 | + | } | |||
| 636 | + | ||||
| 637 | + | // UpdatePosition is a helper method to define mock.On call | |||
| 638 | + | // - ctx context.Context | |||
| 639 | + | // - id entity.FavoriteID | |||
| 640 | + | // - position int | |||
| 641 | + | func (_e *MockFavoriteRepository_Expecter) UpdatePosition(ctx interface{}, id interface{}, position interface{}) *MockFavoriteRepository_UpdatePosition_Call { | |||
| 642 | + | return &MockFavoriteRepository_UpdatePosition_Call{Call: _e.mock.On("UpdatePosition", ctx, id, position)} | |||
| 643 | + | } | |||
| 644 | + | ||||
| 645 | + | func (_c *MockFavoriteRepository_UpdatePosition_Call) Run(run func(ctx context.Context, id entity.FavoriteID, position int)) *MockFavoriteRepository_UpdatePosition_Call { | |||
| 646 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 647 | + | var arg0 context.Context | |||
| 648 | + | if args[0] != nil { | |||
| 649 | + | arg0 = args[0].(context.Context) | |||
| 650 | + | } | |||
| 651 | + | var arg1 entity.FavoriteID | |||
| 652 | + | if args[1] != nil { | |||
| 653 | + | arg1 = args[1].(entity.FavoriteID) | |||
| 654 | + | } | |||
| 655 | + | var arg2 int | |||
| 656 | + | if args[2] != nil { | |||
| 657 | + | arg2 = args[2].(int) | |||
| 658 | + | } | |||
| 659 | + | run( | |||
| 660 | + | arg0, | |||
| 661 | + | arg1, | |||
| 662 | + | arg2, | |||
| 663 | + | ) | |||
| 664 | + | }) | |||
| 665 | + | return _c | |||
| 666 | + | } | |||
| 667 | + | ||||
| 668 | + | func (_c *MockFavoriteRepository_UpdatePosition_Call) Return(err error) *MockFavoriteRepository_UpdatePosition_Call { | |||
| 669 | + | _c.Call.Return(err) | |||
| 670 | + | return _c | |||
| 671 | + | } | |||
| 672 | + | ||||
| 673 | + | func (_c *MockFavoriteRepository_UpdatePosition_Call) RunAndReturn(run func(ctx context.Context, id entity.FavoriteID, position int) error) *MockFavoriteRepository_UpdatePosition_Call { | |||
| 674 | + | _c.Call.Return(run) | |||
| 675 | + | return _c | |||
| 676 | + | } | |||
A internal/domain/repository/mocks/mock_folder_repository.go +414 -0
| @@ -0,0 +1,414 @@ | |||
| 1 | + | // Code generated by mockery; DO NOT EDIT. | |
| 2 | + | // github.com/vektra/mockery | |
| 3 | + | // template: testify | |
| 4 | + | ||
| 5 | + | package mocks | |
| 6 | + | ||
| 7 | + | import ( | |
| 8 | + | "context" | |
| 9 | + | ||
| 10 | + | "github.com/bnema/dumber/internal/domain/entity" | |
| 11 | + | mock "github.com/stretchr/testify/mock" | |
| 12 | + | ) | |
| 13 | + | ||
| 14 | + | // NewMockFolderRepository creates a new instance of MockFolderRepository. 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. | |
| 16 | + | func NewMockFolderRepository(t interface { | |
| 17 | + | mock.TestingT | |
| 18 | + | Cleanup(func()) | |
| 19 | + | }) *MockFolderRepository { | |
| 20 | + | mock := &MockFolderRepository{} | |
| 21 | + | mock.Mock.Test(t) | |
| 22 | + | ||
| 23 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| 24 | + | ||
| 25 | + | return mock | |
| 26 | + | } | |
| 27 | + | ||
| 28 | + | // MockFolderRepository is an autogenerated mock type for the FolderRepository type | |
| 29 | + | type MockFolderRepository struct { | |
| 30 | + | mock.Mock | |
| 31 | + | } | |
| 32 | + | ||
| 33 | + | type MockFolderRepository_Expecter struct { | |
| 34 | + | mock *mock.Mock | |
| 35 | + | } | |
| 36 | + | ||
| 37 | + | func (_m *MockFolderRepository) EXPECT() *MockFolderRepository_Expecter { | |
| 38 | + | return &MockFolderRepository_Expecter{mock: &_m.Mock} | |
| 39 | + | } | |
| 40 | + | ||
| 41 | + | // Delete provides a mock function for the type MockFolderRepository | |
| 42 | + | func (_mock *MockFolderRepository) Delete(ctx context.Context, id entity.FolderID) error { | |
| 43 | + | ret := _mock.Called(ctx, id) | |
| 44 | + | ||
| 45 | + | if len(ret) == 0 { | |
| 46 | + | panic("no return value specified for Delete") | |
| 47 | + | } | |
| 48 | + | ||
| 49 | + | var r0 error | |
| 50 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FolderID) error); ok { | |
| 51 | + | r0 = returnFunc(ctx, id) | |
| 52 | + | } else { | |
| 53 | + | r0 = ret.Error(0) | |
| 54 | + | } | |
| 55 | + | return r0 | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | // MockFolderRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' | |
| 59 | + | type MockFolderRepository_Delete_Call struct { | |
| 60 | + | *mock.Call | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // Delete is a helper method to define mock.On call | |
| 64 | + | // - ctx context.Context | |
| 65 | + | // - id entity.FolderID | |
| 66 | + | func (_e *MockFolderRepository_Expecter) Delete(ctx interface{}, id interface{}) *MockFolderRepository_Delete_Call { | |
| 67 | + | return &MockFolderRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} | |
| 68 | + | } | |
| 69 | + | ||
| 70 | + | func (_c *MockFolderRepository_Delete_Call) Run(run func(ctx context.Context, id entity.FolderID)) *MockFolderRepository_Delete_Call { | |
| 71 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 72 | + | var arg0 context.Context | |
| 73 | + | if args[0] != nil { | |
| 74 | + | arg0 = args[0].(context.Context) | |
| 75 | + | } | |
| 76 | + | var arg1 entity.FolderID | |
| 77 | + | if args[1] != nil { | |
| 78 | + | arg1 = args[1].(entity.FolderID) | |
| 79 | + | } | |
| 80 | + | run( | |
| 81 | + | arg0, | |
| 82 | + | arg1, | |
| 83 | + | ) | |
| 84 | + | }) | |
| 85 | + | return _c | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | func (_c *MockFolderRepository_Delete_Call) Return(err error) *MockFolderRepository_Delete_Call { | |
| 89 | + | _c.Call.Return(err) | |
| 90 | + | return _c | |
| 91 | + | } | |
| 92 | + | ||
| 93 | + | func (_c *MockFolderRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, id entity.FolderID) error) *MockFolderRepository_Delete_Call { | |
| 94 | + | _c.Call.Return(run) | |
| 95 | + | return _c | |
| 96 | + | } | |
| 97 | + | ||
| 98 | + | // FindByID provides a mock function for the type MockFolderRepository | |
| 99 | + | func (_mock *MockFolderRepository) FindByID(ctx context.Context, id entity.FolderID) (*entity.Folder, error) { | |
| 100 | + | ret := _mock.Called(ctx, id) | |
| 101 | + | ||
| 102 | + | if len(ret) == 0 { | |
| 103 | + | panic("no return value specified for FindByID") | |
| 104 | + | } | |
| 105 | + | ||
| 106 | + | var r0 *entity.Folder | |
| 107 | + | var r1 error | |
| 108 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FolderID) (*entity.Folder, error)); ok { | |
| 109 | + | return returnFunc(ctx, id) | |
| 110 | + | } | |
| 111 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FolderID) *entity.Folder); ok { | |
| 112 | + | r0 = returnFunc(ctx, id) | |
| 113 | + | } else { | |
| 114 | + | if ret.Get(0) != nil { | |
| 115 | + | r0 = ret.Get(0).(*entity.Folder) | |
| 116 | + | } | |
| 117 | + | } | |
| 118 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, entity.FolderID) error); ok { | |
| 119 | + | r1 = returnFunc(ctx, id) | |
| 120 | + | } else { | |
| 121 | + | r1 = ret.Error(1) | |
| 122 | + | } | |
| 123 | + | return r0, r1 | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | // MockFolderRepository_FindByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByID' | |
| 127 | + | type MockFolderRepository_FindByID_Call struct { | |
| 128 | + | *mock.Call | |
| 129 | + | } | |
| 130 | + | ||
| 131 | + | // FindByID is a helper method to define mock.On call | |
| 132 | + | // - ctx context.Context | |
| 133 | + | // - id entity.FolderID | |
| 134 | + | func (_e *MockFolderRepository_Expecter) FindByID(ctx interface{}, id interface{}) *MockFolderRepository_FindByID_Call { | |
| 135 | + | return &MockFolderRepository_FindByID_Call{Call: _e.mock.On("FindByID", ctx, id)} | |
| 136 | + | } | |
| 137 | + | ||
| 138 | + | func (_c *MockFolderRepository_FindByID_Call) Run(run func(ctx context.Context, id entity.FolderID)) *MockFolderRepository_FindByID_Call { | |
| 139 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 140 | + | var arg0 context.Context | |
| 141 | + | if args[0] != nil { | |
| 142 | + | arg0 = args[0].(context.Context) | |
| 143 | + | } | |
| 144 | + | var arg1 entity.FolderID | |
| 145 | + | if args[1] != nil { | |
| 146 | + | arg1 = args[1].(entity.FolderID) | |
| 147 | + | } | |
| 148 | + | run( | |
| 149 | + | arg0, | |
| 150 | + | arg1, | |
| 151 | + | ) | |
| 152 | + | }) | |
| 153 | + | return _c | |
| 154 | + | } | |
| 155 | + | ||
| 156 | + | func (_c *MockFolderRepository_FindByID_Call) Return(folder *entity.Folder, err error) *MockFolderRepository_FindByID_Call { | |
| 157 | + | _c.Call.Return(folder, err) | |
| 158 | + | return _c | |
| 159 | + | } | |
| 160 | + | ||
| 161 | + | func (_c *MockFolderRepository_FindByID_Call) RunAndReturn(run func(ctx context.Context, id entity.FolderID) (*entity.Folder, error)) *MockFolderRepository_FindByID_Call { | |
| 162 | + | _c.Call.Return(run) | |
| 163 | + | return _c | |
| 164 | + | } | |
| 165 | + | ||
| 166 | + | // GetAll provides a mock function for the type MockFolderRepository | |
| 167 | + | func (_mock *MockFolderRepository) GetAll(ctx context.Context) ([]*entity.Folder, error) { | |
| 168 | + | ret := _mock.Called(ctx) | |
| 169 | + | ||
| 170 | + | if len(ret) == 0 { | |
| 171 | + | panic("no return value specified for GetAll") | |
| 172 | + | } | |
| 173 | + | ||
| 174 | + | var r0 []*entity.Folder | |
| 175 | + | var r1 error | |
| 176 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.Folder, error)); ok { | |
| 177 | + | return returnFunc(ctx) | |
| 178 | + | } | |
| 179 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.Folder); ok { | |
| 180 | + | r0 = returnFunc(ctx) | |
| 181 | + | } else { | |
| 182 | + | if ret.Get(0) != nil { | |
| 183 | + | r0 = ret.Get(0).([]*entity.Folder) | |
| 184 | + | } | |
| 185 | + | } | |
| 186 | + | if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { | |
| 187 | + | r1 = returnFunc(ctx) | |
| 188 | + | } else { | |
| 189 | + | r1 = ret.Error(1) | |
| 190 | + | } | |
| 191 | + | return r0, r1 | |
| 192 | + | } | |
| 193 | + | ||
| 194 | + | // MockFolderRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' | |
| 195 | + | type MockFolderRepository_GetAll_Call struct { | |
| 196 | + | *mock.Call | |
| 197 | + | } | |
| 198 | + | ||
| 199 | + | // GetAll is a helper method to define mock.On call | |
| 200 | + | // - ctx context.Context | |
| 201 | + | func (_e *MockFolderRepository_Expecter) GetAll(ctx interface{}) *MockFolderRepository_GetAll_Call { | |
| 202 | + | return &MockFolderRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx)} | |
| 203 | + | } | |
| 204 | + | ||
| 205 | + | func (_c *MockFolderRepository_GetAll_Call) Run(run func(ctx context.Context)) *MockFolderRepository_GetAll_Call { | |
| 206 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 207 | + | var arg0 context.Context | |
| 208 | + | if args[0] != nil { | |
| 209 | + | arg0 = args[0].(context.Context) | |
| 210 | + | } | |
| 211 | + | run( | |
| 212 | + | arg0, | |
| 213 | + | ) | |
| 214 | + | }) | |
| 215 | + | return _c | |
| 216 | + | } | |
| 217 | + | ||
| 218 | + | func (_c *MockFolderRepository_GetAll_Call) Return(folders []*entity.Folder, err error) *MockFolderRepository_GetAll_Call { | |
| 219 | + | _c.Call.Return(folders, err) | |
| 220 | + | return _c | |
| 221 | + | } | |
| 222 | + | ||
| 223 | + | func (_c *MockFolderRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.Folder, error)) *MockFolderRepository_GetAll_Call { | |
| 224 | + | _c.Call.Return(run) | |
| 225 | + | return _c | |
| 226 | + | } | |
| 227 | + | ||
| 228 | + | // GetChildren provides a mock function for the type MockFolderRepository | |
| 229 | + | func (_mock *MockFolderRepository) GetChildren(ctx context.Context, parentID *entity.FolderID) ([]*entity.Folder, error) { | |
| 230 | + | ret := _mock.Called(ctx, parentID) | |
| 231 | + | ||
| 232 | + | if len(ret) == 0 { | |
| 233 | + | panic("no return value specified for GetChildren") | |
| 234 | + | } | |
| 235 | + | ||
| 236 | + | var r0 []*entity.Folder | |
| 237 | + | var r1 error | |
| 238 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.FolderID) ([]*entity.Folder, error)); ok { | |
| 239 | + | return returnFunc(ctx, parentID) | |
| 240 | + | } | |
| 241 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.FolderID) []*entity.Folder); ok { | |
| 242 | + | r0 = returnFunc(ctx, parentID) | |
| 243 | + | } else { | |
| 244 | + | if ret.Get(0) != nil { | |
| 245 | + | r0 = ret.Get(0).([]*entity.Folder) | |
| 246 | + | } | |
| 247 | + | } | |
| 248 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, *entity.FolderID) error); ok { | |
| 249 | + | r1 = returnFunc(ctx, parentID) | |
| 250 | + | } else { | |
| 251 | + | r1 = ret.Error(1) | |
| 252 | + | } | |
| 253 | + | return r0, r1 | |
| 254 | + | } | |
| 255 | + | ||
| 256 | + | // MockFolderRepository_GetChildren_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetChildren' | |
| 257 | + | type MockFolderRepository_GetChildren_Call struct { | |
| 258 | + | *mock.Call | |
| 259 | + | } | |
| 260 | + | ||
| 261 | + | // GetChildren is a helper method to define mock.On call | |
| 262 | + | // - ctx context.Context | |
| 263 | + | // - parentID *entity.FolderID | |
| 264 | + | func (_e *MockFolderRepository_Expecter) GetChildren(ctx interface{}, parentID interface{}) *MockFolderRepository_GetChildren_Call { | |
| 265 | + | return &MockFolderRepository_GetChildren_Call{Call: _e.mock.On("GetChildren", ctx, parentID)} | |
| 266 | + | } | |
| 267 | + | ||
| 268 | + | func (_c *MockFolderRepository_GetChildren_Call) Run(run func(ctx context.Context, parentID *entity.FolderID)) *MockFolderRepository_GetChildren_Call { | |
| 269 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 270 | + | var arg0 context.Context | |
| 271 | + | if args[0] != nil { | |
| 272 | + | arg0 = args[0].(context.Context) | |
| 273 | + | } | |
| 274 | + | var arg1 *entity.FolderID | |
| 275 | + | if args[1] != nil { | |
| 276 | + | arg1 = args[1].(*entity.FolderID) | |
| 277 | + | } | |
| 278 | + | run( | |
| 279 | + | arg0, | |
| 280 | + | arg1, | |
| 281 | + | ) | |
| 282 | + | }) | |
| 283 | + | return _c | |
| 284 | + | } | |
| 285 | + | ||
| 286 | + | func (_c *MockFolderRepository_GetChildren_Call) Return(folders []*entity.Folder, err error) *MockFolderRepository_GetChildren_Call { | |
| 287 | + | _c.Call.Return(folders, err) | |
| 288 | + | return _c | |
| 289 | + | } | |
| 290 | + | ||
| 291 | + | func (_c *MockFolderRepository_GetChildren_Call) RunAndReturn(run func(ctx context.Context, parentID *entity.FolderID) ([]*entity.Folder, error)) *MockFolderRepository_GetChildren_Call { | |
| 292 | + | _c.Call.Return(run) | |
| 293 | + | return _c | |
| 294 | + | } | |
| 295 | + | ||
| 296 | + | // Save provides a mock function for the type MockFolderRepository | |
| 297 | + | func (_mock *MockFolderRepository) Save(ctx context.Context, folder *entity.Folder) error { | |
| 298 | + | ret := _mock.Called(ctx, folder) | |
| 299 | + | ||
| 300 | + | if len(ret) == 0 { | |
| 301 | + | panic("no return value specified for Save") | |
| 302 | + | } | |
| 303 | + | ||
| 304 | + | var r0 error | |
| 305 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.Folder) error); ok { | |
| 306 | + | r0 = returnFunc(ctx, folder) | |
| 307 | + | } else { | |
| 308 | + | r0 = ret.Error(0) | |
| 309 | + | } | |
| 310 | + | return r0 | |
| 311 | + | } | |
| 312 | + | ||
| 313 | + | // MockFolderRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' | |
| 314 | + | type MockFolderRepository_Save_Call struct { | |
| 315 | + | *mock.Call | |
| 316 | + | } | |
| 317 | + | ||
| 318 | + | // Save is a helper method to define mock.On call | |
| 319 | + | // - ctx context.Context | |
| 320 | + | // - folder *entity.Folder | |
| 321 | + | func (_e *MockFolderRepository_Expecter) Save(ctx interface{}, folder interface{}) *MockFolderRepository_Save_Call { | |
| 322 | + | return &MockFolderRepository_Save_Call{Call: _e.mock.On("Save", ctx, folder)} | |
| 323 | + | } | |
| 324 | + | ||
| 325 | + | func (_c *MockFolderRepository_Save_Call) Run(run func(ctx context.Context, folder *entity.Folder)) *MockFolderRepository_Save_Call { | |
| 326 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 327 | + | var arg0 context.Context | |
| 328 | + | if args[0] != nil { | |
| 329 | + | arg0 = args[0].(context.Context) | |
| 330 | + | } | |
| 331 | + | var arg1 *entity.Folder | |
| 332 | + | if args[1] != nil { | |
| 333 | + | arg1 = args[1].(*entity.Folder) | |
| 334 | + | } | |
| 335 | + | run( | |
| 336 | + | arg0, | |
| 337 | + | arg1, | |
| 338 | + | ) | |
| 339 | + | }) | |
| 340 | + | return _c | |
| 341 | + | } | |
| 342 | + | ||
| 343 | + | func (_c *MockFolderRepository_Save_Call) Return(err error) *MockFolderRepository_Save_Call { | |
| 344 | + | _c.Call.Return(err) | |
| 345 | + | return _c | |
| 346 | + | } | |
| 347 | + | ||
| 348 | + | func (_c *MockFolderRepository_Save_Call) RunAndReturn(run func(ctx context.Context, folder *entity.Folder) error) *MockFolderRepository_Save_Call { | |
| 349 | + | _c.Call.Return(run) | |
| 350 | + | return _c | |
| 351 | + | } | |
| 352 | + | ||
| 353 | + | // UpdatePosition provides a mock function for the type MockFolderRepository | |
| 354 | + | func (_mock *MockFolderRepository) UpdatePosition(ctx context.Context, id entity.FolderID, position int) error { | |
| 355 | + | ret := _mock.Called(ctx, id, position) | |
| 356 | + | ||
| 357 | + | if len(ret) == 0 { | |
| 358 | + | panic("no return value specified for UpdatePosition") | |
| 359 | + | } | |
| 360 | + | ||
| 361 | + | var r0 error | |
| 362 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FolderID, int) error); ok { | |
| 363 | + | r0 = returnFunc(ctx, id, position) | |
| 364 | + | } else { | |
| 365 | + | r0 = ret.Error(0) | |
| 366 | + | } | |
| 367 | + | return r0 | |
| 368 | + | } | |
| 369 | + | ||
| 370 | + | // MockFolderRepository_UpdatePosition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePosition' | |
| 371 | + | type MockFolderRepository_UpdatePosition_Call struct { | |
| 372 | + | *mock.Call | |
| 373 | + | } | |
| 374 | + | ||
| 375 | + | // UpdatePosition is a helper method to define mock.On call | |
| 376 | + | // - ctx context.Context | |
| 377 | + | // - id entity.FolderID | |
| 378 | + | // - position int | |
| 379 | + | func (_e *MockFolderRepository_Expecter) UpdatePosition(ctx interface{}, id interface{}, position interface{}) *MockFolderRepository_UpdatePosition_Call { | |
| 380 | + | return &MockFolderRepository_UpdatePosition_Call{Call: _e.mock.On("UpdatePosition", ctx, id, position)} | |
| 381 | + | } | |
| 382 | + | ||
| 383 | + | func (_c *MockFolderRepository_UpdatePosition_Call) Run(run func(ctx context.Context, id entity.FolderID, position int)) *MockFolderRepository_UpdatePosition_Call { | |
| 384 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 385 | + | var arg0 context.Context | |
| 386 | + | if args[0] != nil { | |
| 387 | + | arg0 = args[0].(context.Context) | |
| 388 | + | } | |
| 389 | + | var arg1 entity.FolderID | |
| 390 | + | if args[1] != nil { | |
| 391 | + | arg1 = args[1].(entity.FolderID) | |
| 392 | + | } | |
| 393 | + | var arg2 int | |
| 394 | + | if args[2] != nil { | |
| 395 | + | arg2 = args[2].(int) | |
| 396 | + | } | |
| 397 | + | run( | |
| 398 | + | arg0, | |
| 399 | + | arg1, | |
| 400 | + | arg2, | |
| 401 | + | ) | |
| 402 | + | }) | |
| 403 | + | return _c | |
| 404 | + | } | |
| 405 | + | ||
| 406 | + | func (_c *MockFolderRepository_UpdatePosition_Call) Return(err error) *MockFolderRepository_UpdatePosition_Call { | |
| 407 | + | _c.Call.Return(err) | |
| 408 | + | return _c | |
| 409 | + | } | |
| 410 | + | ||
| 411 | + | func (_c *MockFolderRepository_UpdatePosition_Call) RunAndReturn(run func(ctx context.Context, id entity.FolderID, position int) error) *MockFolderRepository_UpdatePosition_Call { | |
| 412 | + | _c.Call.Return(run) | |
| 413 | + | return _c | |
| 414 | + | } | |
| @@ -0,0 +1,414 @@ | |||||
| 1 | + | // Code generated by mockery; DO NOT EDIT. | |||
| 2 | + | // github.com/vektra/mockery | |||
| 3 | + | // template: testify | |||
| 4 | + | ||||
| 5 | + | package mocks | |||
| 6 | + | ||||
| 7 | + | import ( | |||
| 8 | + | "context" | |||
| 9 | + | ||||
| 10 | + | "github.com/bnema/dumber/internal/domain/entity" | |||
| 11 | + | mock "github.com/stretchr/testify/mock" | |||
| 12 | + | ) | |||
| 13 | + | ||||
| 14 | + | // NewMockFolderRepository creates a new instance of MockFolderRepository. 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. | |||
| 16 | + | func NewMockFolderRepository(t interface { | |||
| 17 | + | mock.TestingT | |||
| 18 | + | Cleanup(func()) | |||
| 19 | + | }) *MockFolderRepository { | |||
| 20 | + | mock := &MockFolderRepository{} | |||
| 21 | + | mock.Mock.Test(t) | |||
| 22 | + | ||||
| 23 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |||
| 24 | + | ||||
| 25 | + | return mock | |||
| 26 | + | } | |||
| 27 | + | ||||
| 28 | + | // MockFolderRepository is an autogenerated mock type for the FolderRepository type | |||
| 29 | + | type MockFolderRepository struct { | |||
| 30 | + | mock.Mock | |||
| 31 | + | } | |||
| 32 | + | ||||
| 33 | + | type MockFolderRepository_Expecter struct { | |||
| 34 | + | mock *mock.Mock | |||
| 35 | + | } | |||
| 36 | + | ||||
| 37 | + | func (_m *MockFolderRepository) EXPECT() *MockFolderRepository_Expecter { | |||
| 38 | + | return &MockFolderRepository_Expecter{mock: &_m.Mock} | |||
| 39 | + | } | |||
| 40 | + | ||||
| 41 | + | // Delete provides a mock function for the type MockFolderRepository | |||
| 42 | + | func (_mock *MockFolderRepository) Delete(ctx context.Context, id entity.FolderID) error { | |||
| 43 | + | ret := _mock.Called(ctx, id) | |||
| 44 | + | ||||
| 45 | + | if len(ret) == 0 { | |||
| 46 | + | panic("no return value specified for Delete") | |||
| 47 | + | } | |||
| 48 | + | ||||
| 49 | + | var r0 error | |||
| 50 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FolderID) error); ok { | |||
| 51 | + | r0 = returnFunc(ctx, id) | |||
| 52 | + | } else { | |||
| 53 | + | r0 = ret.Error(0) | |||
| 54 | + | } | |||
| 55 | + | return r0 | |||
| 56 | + | } | |||
| 57 | + | ||||
| 58 | + | // MockFolderRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' | |||
| 59 | + | type MockFolderRepository_Delete_Call struct { | |||
| 60 | + | *mock.Call | |||
| 61 | + | } | |||
| 62 | + | ||||
| 63 | + | // Delete is a helper method to define mock.On call | |||
| 64 | + | // - ctx context.Context | |||
| 65 | + | // - id entity.FolderID | |||
| 66 | + | func (_e *MockFolderRepository_Expecter) Delete(ctx interface{}, id interface{}) *MockFolderRepository_Delete_Call { | |||
| 67 | + | return &MockFolderRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} | |||
| 68 | + | } | |||
| 69 | + | ||||
| 70 | + | func (_c *MockFolderRepository_Delete_Call) Run(run func(ctx context.Context, id entity.FolderID)) *MockFolderRepository_Delete_Call { | |||
| 71 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 72 | + | var arg0 context.Context | |||
| 73 | + | if args[0] != nil { | |||
| 74 | + | arg0 = args[0].(context.Context) | |||
| 75 | + | } | |||
| 76 | + | var arg1 entity.FolderID | |||
| 77 | + | if args[1] != nil { | |||
| 78 | + | arg1 = args[1].(entity.FolderID) | |||
| 79 | + | } | |||
| 80 | + | run( | |||
| 81 | + | arg0, | |||
| 82 | + | arg1, | |||
| 83 | + | ) | |||
| 84 | + | }) | |||
| 85 | + | return _c | |||
| 86 | + | } | |||
| 87 | + | ||||
| 88 | + | func (_c *MockFolderRepository_Delete_Call) Return(err error) *MockFolderRepository_Delete_Call { | |||
| 89 | + | _c.Call.Return(err) | |||
| 90 | + | return _c | |||
| 91 | + | } | |||
| 92 | + | ||||
| 93 | + | func (_c *MockFolderRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, id entity.FolderID) error) *MockFolderRepository_Delete_Call { | |||
| 94 | + | _c.Call.Return(run) | |||
| 95 | + | return _c | |||
| 96 | + | } | |||
| 97 | + | ||||
| 98 | + | // FindByID provides a mock function for the type MockFolderRepository | |||
| 99 | + | func (_mock *MockFolderRepository) FindByID(ctx context.Context, id entity.FolderID) (*entity.Folder, error) { | |||
| 100 | + | ret := _mock.Called(ctx, id) | |||
| 101 | + | ||||
| 102 | + | if len(ret) == 0 { | |||
| 103 | + | panic("no return value specified for FindByID") | |||
| 104 | + | } | |||
| 105 | + | ||||
| 106 | + | var r0 *entity.Folder | |||
| 107 | + | var r1 error | |||
| 108 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FolderID) (*entity.Folder, error)); ok { | |||
| 109 | + | return returnFunc(ctx, id) | |||
| 110 | + | } | |||
| 111 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FolderID) *entity.Folder); ok { | |||
| 112 | + | r0 = returnFunc(ctx, id) | |||
| 113 | + | } else { | |||
| 114 | + | if ret.Get(0) != nil { | |||
| 115 | + | r0 = ret.Get(0).(*entity.Folder) | |||
| 116 | + | } | |||
| 117 | + | } | |||
| 118 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, entity.FolderID) error); ok { | |||
| 119 | + | r1 = returnFunc(ctx, id) | |||
| 120 | + | } else { | |||
| 121 | + | r1 = ret.Error(1) | |||
| 122 | + | } | |||
| 123 | + | return r0, r1 | |||
| 124 | + | } | |||
| 125 | + | ||||
| 126 | + | // MockFolderRepository_FindByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByID' | |||
| 127 | + | type MockFolderRepository_FindByID_Call struct { | |||
| 128 | + | *mock.Call | |||
| 129 | + | } | |||
| 130 | + | ||||
| 131 | + | // FindByID is a helper method to define mock.On call | |||
| 132 | + | // - ctx context.Context | |||
| 133 | + | // - id entity.FolderID | |||
| 134 | + | func (_e *MockFolderRepository_Expecter) FindByID(ctx interface{}, id interface{}) *MockFolderRepository_FindByID_Call { | |||
| 135 | + | return &MockFolderRepository_FindByID_Call{Call: _e.mock.On("FindByID", ctx, id)} | |||
| 136 | + | } | |||
| 137 | + | ||||
| 138 | + | func (_c *MockFolderRepository_FindByID_Call) Run(run func(ctx context.Context, id entity.FolderID)) *MockFolderRepository_FindByID_Call { | |||
| 139 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 140 | + | var arg0 context.Context | |||
| 141 | + | if args[0] != nil { | |||
| 142 | + | arg0 = args[0].(context.Context) | |||
| 143 | + | } | |||
| 144 | + | var arg1 entity.FolderID | |||
| 145 | + | if args[1] != nil { | |||
| 146 | + | arg1 = args[1].(entity.FolderID) | |||
| 147 | + | } | |||
| 148 | + | run( | |||
| 149 | + | arg0, | |||
| 150 | + | arg1, | |||
| 151 | + | ) | |||
| 152 | + | }) | |||
| 153 | + | return _c | |||
| 154 | + | } | |||
| 155 | + | ||||
| 156 | + | func (_c *MockFolderRepository_FindByID_Call) Return(folder *entity.Folder, err error) *MockFolderRepository_FindByID_Call { | |||
| 157 | + | _c.Call.Return(folder, err) | |||
| 158 | + | return _c | |||
| 159 | + | } | |||
| 160 | + | ||||
| 161 | + | func (_c *MockFolderRepository_FindByID_Call) RunAndReturn(run func(ctx context.Context, id entity.FolderID) (*entity.Folder, error)) *MockFolderRepository_FindByID_Call { | |||
| 162 | + | _c.Call.Return(run) | |||
| 163 | + | return _c | |||
| 164 | + | } | |||
| 165 | + | ||||
| 166 | + | // GetAll provides a mock function for the type MockFolderRepository | |||
| 167 | + | func (_mock *MockFolderRepository) GetAll(ctx context.Context) ([]*entity.Folder, error) { | |||
| 168 | + | ret := _mock.Called(ctx) | |||
| 169 | + | ||||
| 170 | + | if len(ret) == 0 { | |||
| 171 | + | panic("no return value specified for GetAll") | |||
| 172 | + | } | |||
| 173 | + | ||||
| 174 | + | var r0 []*entity.Folder | |||
| 175 | + | var r1 error | |||
| 176 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.Folder, error)); ok { | |||
| 177 | + | return returnFunc(ctx) | |||
| 178 | + | } | |||
| 179 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.Folder); ok { | |||
| 180 | + | r0 = returnFunc(ctx) | |||
| 181 | + | } else { | |||
| 182 | + | if ret.Get(0) != nil { | |||
| 183 | + | r0 = ret.Get(0).([]*entity.Folder) | |||
| 184 | + | } | |||
| 185 | + | } | |||
| 186 | + | if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { | |||
| 187 | + | r1 = returnFunc(ctx) | |||
| 188 | + | } else { | |||
| 189 | + | r1 = ret.Error(1) | |||
| 190 | + | } | |||
| 191 | + | return r0, r1 | |||
| 192 | + | } | |||
| 193 | + | ||||
| 194 | + | // MockFolderRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' | |||
| 195 | + | type MockFolderRepository_GetAll_Call struct { | |||
| 196 | + | *mock.Call | |||
| 197 | + | } | |||
| 198 | + | ||||
| 199 | + | // GetAll is a helper method to define mock.On call | |||
| 200 | + | // - ctx context.Context | |||
| 201 | + | func (_e *MockFolderRepository_Expecter) GetAll(ctx interface{}) *MockFolderRepository_GetAll_Call { | |||
| 202 | + | return &MockFolderRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx)} | |||
| 203 | + | } | |||
| 204 | + | ||||
| 205 | + | func (_c *MockFolderRepository_GetAll_Call) Run(run func(ctx context.Context)) *MockFolderRepository_GetAll_Call { | |||
| 206 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 207 | + | var arg0 context.Context | |||
| 208 | + | if args[0] != nil { | |||
| 209 | + | arg0 = args[0].(context.Context) | |||
| 210 | + | } | |||
| 211 | + | run( | |||
| 212 | + | arg0, | |||
| 213 | + | ) | |||
| 214 | + | }) | |||
| 215 | + | return _c | |||
| 216 | + | } | |||
| 217 | + | ||||
| 218 | + | func (_c *MockFolderRepository_GetAll_Call) Return(folders []*entity.Folder, err error) *MockFolderRepository_GetAll_Call { | |||
| 219 | + | _c.Call.Return(folders, err) | |||
| 220 | + | return _c | |||
| 221 | + | } | |||
| 222 | + | ||||
| 223 | + | func (_c *MockFolderRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.Folder, error)) *MockFolderRepository_GetAll_Call { | |||
| 224 | + | _c.Call.Return(run) | |||
| 225 | + | return _c | |||
| 226 | + | } | |||
| 227 | + | ||||
| 228 | + | // GetChildren provides a mock function for the type MockFolderRepository | |||
| 229 | + | func (_mock *MockFolderRepository) GetChildren(ctx context.Context, parentID *entity.FolderID) ([]*entity.Folder, error) { | |||
| 230 | + | ret := _mock.Called(ctx, parentID) | |||
| 231 | + | ||||
| 232 | + | if len(ret) == 0 { | |||
| 233 | + | panic("no return value specified for GetChildren") | |||
| 234 | + | } | |||
| 235 | + | ||||
| 236 | + | var r0 []*entity.Folder | |||
| 237 | + | var r1 error | |||
| 238 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.FolderID) ([]*entity.Folder, error)); ok { | |||
| 239 | + | return returnFunc(ctx, parentID) | |||
| 240 | + | } | |||
| 241 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.FolderID) []*entity.Folder); ok { | |||
| 242 | + | r0 = returnFunc(ctx, parentID) | |||
| 243 | + | } else { | |||
| 244 | + | if ret.Get(0) != nil { | |||
| 245 | + | r0 = ret.Get(0).([]*entity.Folder) | |||
| 246 | + | } | |||
| 247 | + | } | |||
| 248 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, *entity.FolderID) error); ok { | |||
| 249 | + | r1 = returnFunc(ctx, parentID) | |||
| 250 | + | } else { | |||
| 251 | + | r1 = ret.Error(1) | |||
| 252 | + | } | |||
| 253 | + | return r0, r1 | |||
| 254 | + | } | |||
| 255 | + | ||||
| 256 | + | // MockFolderRepository_GetChildren_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetChildren' | |||
| 257 | + | type MockFolderRepository_GetChildren_Call struct { | |||
| 258 | + | *mock.Call | |||
| 259 | + | } | |||
| 260 | + | ||||
| 261 | + | // GetChildren is a helper method to define mock.On call | |||
| 262 | + | // - ctx context.Context | |||
| 263 | + | // - parentID *entity.FolderID | |||
| 264 | + | func (_e *MockFolderRepository_Expecter) GetChildren(ctx interface{}, parentID interface{}) *MockFolderRepository_GetChildren_Call { | |||
| 265 | + | return &MockFolderRepository_GetChildren_Call{Call: _e.mock.On("GetChildren", ctx, parentID)} | |||
| 266 | + | } | |||
| 267 | + | ||||
| 268 | + | func (_c *MockFolderRepository_GetChildren_Call) Run(run func(ctx context.Context, parentID *entity.FolderID)) *MockFolderRepository_GetChildren_Call { | |||
| 269 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 270 | + | var arg0 context.Context | |||
| 271 | + | if args[0] != nil { | |||
| 272 | + | arg0 = args[0].(context.Context) | |||
| 273 | + | } | |||
| 274 | + | var arg1 *entity.FolderID | |||
| 275 | + | if args[1] != nil { | |||
| 276 | + | arg1 = args[1].(*entity.FolderID) | |||
| 277 | + | } | |||
| 278 | + | run( | |||
| 279 | + | arg0, | |||
| 280 | + | arg1, | |||
| 281 | + | ) | |||
| 282 | + | }) | |||
| 283 | + | return _c | |||
| 284 | + | } | |||
| 285 | + | ||||
| 286 | + | func (_c *MockFolderRepository_GetChildren_Call) Return(folders []*entity.Folder, err error) *MockFolderRepository_GetChildren_Call { | |||
| 287 | + | _c.Call.Return(folders, err) | |||
| 288 | + | return _c | |||
| 289 | + | } | |||
| 290 | + | ||||
| 291 | + | func (_c *MockFolderRepository_GetChildren_Call) RunAndReturn(run func(ctx context.Context, parentID *entity.FolderID) ([]*entity.Folder, error)) *MockFolderRepository_GetChildren_Call { | |||
| 292 | + | _c.Call.Return(run) | |||
| 293 | + | return _c | |||
| 294 | + | } | |||
| 295 | + | ||||
| 296 | + | // Save provides a mock function for the type MockFolderRepository | |||
| 297 | + | func (_mock *MockFolderRepository) Save(ctx context.Context, folder *entity.Folder) error { | |||
| 298 | + | ret := _mock.Called(ctx, folder) | |||
| 299 | + | ||||
| 300 | + | if len(ret) == 0 { | |||
| 301 | + | panic("no return value specified for Save") | |||
| 302 | + | } | |||
| 303 | + | ||||
| 304 | + | var r0 error | |||
| 305 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.Folder) error); ok { | |||
| 306 | + | r0 = returnFunc(ctx, folder) | |||
| 307 | + | } else { | |||
| 308 | + | r0 = ret.Error(0) | |||
| 309 | + | } | |||
| 310 | + | return r0 | |||
| 311 | + | } | |||
| 312 | + | ||||
| 313 | + | // MockFolderRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' | |||
| 314 | + | type MockFolderRepository_Save_Call struct { | |||
| 315 | + | *mock.Call | |||
| 316 | + | } | |||
| 317 | + | ||||
| 318 | + | // Save is a helper method to define mock.On call | |||
| 319 | + | // - ctx context.Context | |||
| 320 | + | // - folder *entity.Folder | |||
| 321 | + | func (_e *MockFolderRepository_Expecter) Save(ctx interface{}, folder interface{}) *MockFolderRepository_Save_Call { | |||
| 322 | + | return &MockFolderRepository_Save_Call{Call: _e.mock.On("Save", ctx, folder)} | |||
| 323 | + | } | |||
| 324 | + | ||||
| 325 | + | func (_c *MockFolderRepository_Save_Call) Run(run func(ctx context.Context, folder *entity.Folder)) *MockFolderRepository_Save_Call { | |||
| 326 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 327 | + | var arg0 context.Context | |||
| 328 | + | if args[0] != nil { | |||
| 329 | + | arg0 = args[0].(context.Context) | |||
| 330 | + | } | |||
| 331 | + | var arg1 *entity.Folder | |||
| 332 | + | if args[1] != nil { | |||
| 333 | + | arg1 = args[1].(*entity.Folder) | |||
| 334 | + | } | |||
| 335 | + | run( | |||
| 336 | + | arg0, | |||
| 337 | + | arg1, | |||
| 338 | + | ) | |||
| 339 | + | }) | |||
| 340 | + | return _c | |||
| 341 | + | } | |||
| 342 | + | ||||
| 343 | + | func (_c *MockFolderRepository_Save_Call) Return(err error) *MockFolderRepository_Save_Call { | |||
| 344 | + | _c.Call.Return(err) | |||
| 345 | + | return _c | |||
| 346 | + | } | |||
| 347 | + | ||||
| 348 | + | func (_c *MockFolderRepository_Save_Call) RunAndReturn(run func(ctx context.Context, folder *entity.Folder) error) *MockFolderRepository_Save_Call { | |||
| 349 | + | _c.Call.Return(run) | |||
| 350 | + | return _c | |||
| 351 | + | } | |||
| 352 | + | ||||
| 353 | + | // UpdatePosition provides a mock function for the type MockFolderRepository | |||
| 354 | + | func (_mock *MockFolderRepository) UpdatePosition(ctx context.Context, id entity.FolderID, position int) error { | |||
| 355 | + | ret := _mock.Called(ctx, id, position) | |||
| 356 | + | ||||
| 357 | + | if len(ret) == 0 { | |||
| 358 | + | panic("no return value specified for UpdatePosition") | |||
| 359 | + | } | |||
| 360 | + | ||||
| 361 | + | var r0 error | |||
| 362 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FolderID, int) error); ok { | |||
| 363 | + | r0 = returnFunc(ctx, id, position) | |||
| 364 | + | } else { | |||
| 365 | + | r0 = ret.Error(0) | |||
| 366 | + | } | |||
| 367 | + | return r0 | |||
| 368 | + | } | |||
| 369 | + | ||||
| 370 | + | // MockFolderRepository_UpdatePosition_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePosition' | |||
| 371 | + | type MockFolderRepository_UpdatePosition_Call struct { | |||
| 372 | + | *mock.Call | |||
| 373 | + | } | |||
| 374 | + | ||||
| 375 | + | // UpdatePosition is a helper method to define mock.On call | |||
| 376 | + | // - ctx context.Context | |||
| 377 | + | // - id entity.FolderID | |||
| 378 | + | // - position int | |||
| 379 | + | func (_e *MockFolderRepository_Expecter) UpdatePosition(ctx interface{}, id interface{}, position interface{}) *MockFolderRepository_UpdatePosition_Call { | |||
| 380 | + | return &MockFolderRepository_UpdatePosition_Call{Call: _e.mock.On("UpdatePosition", ctx, id, position)} | |||
| 381 | + | } | |||
| 382 | + | ||||
| 383 | + | func (_c *MockFolderRepository_UpdatePosition_Call) Run(run func(ctx context.Context, id entity.FolderID, position int)) *MockFolderRepository_UpdatePosition_Call { | |||
| 384 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 385 | + | var arg0 context.Context | |||
| 386 | + | if args[0] != nil { | |||
| 387 | + | arg0 = args[0].(context.Context) | |||
| 388 | + | } | |||
| 389 | + | var arg1 entity.FolderID | |||
| 390 | + | if args[1] != nil { | |||
| 391 | + | arg1 = args[1].(entity.FolderID) | |||
| 392 | + | } | |||
| 393 | + | var arg2 int | |||
| 394 | + | if args[2] != nil { | |||
| 395 | + | arg2 = args[2].(int) | |||
| 396 | + | } | |||
| 397 | + | run( | |||
| 398 | + | arg0, | |||
| 399 | + | arg1, | |||
| 400 | + | arg2, | |||
| 401 | + | ) | |||
| 402 | + | }) | |||
| 403 | + | return _c | |||
| 404 | + | } | |||
| 405 | + | ||||
| 406 | + | func (_c *MockFolderRepository_UpdatePosition_Call) Return(err error) *MockFolderRepository_UpdatePosition_Call { | |||
| 407 | + | _c.Call.Return(err) | |||
| 408 | + | return _c | |||
| 409 | + | } | |||
| 410 | + | ||||
| 411 | + | func (_c *MockFolderRepository_UpdatePosition_Call) RunAndReturn(run func(ctx context.Context, id entity.FolderID, position int) error) *MockFolderRepository_UpdatePosition_Call { | |||
| 412 | + | _c.Call.Return(run) | |||
| 413 | + | return _c | |||
| 414 | + | } | |||
A internal/domain/repository/mocks/mock_history_repository.go +852 -0
| @@ -0,0 +1,852 @@ | |||
| 1 | + | // Code generated by mockery; DO NOT EDIT. | |
| 2 | + | // github.com/vektra/mockery | |
| 3 | + | // template: testify | |
| 4 | + | ||
| 5 | + | package mocks | |
| 6 | + | ||
| 7 | + | import ( | |
| 8 | + | "context" | |
| 9 | + | "time" | |
| 10 | + | ||
| 11 | + | "github.com/bnema/dumber/internal/domain/entity" | |
| 12 | + | mock "github.com/stretchr/testify/mock" | |
| 13 | + | ) | |
| 14 | + | ||
| 15 | + | // NewMockHistoryRepository creates a new instance of MockHistoryRepository. 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. | |
| 17 | + | func NewMockHistoryRepository(t interface { | |
| 18 | + | mock.TestingT | |
| 19 | + | Cleanup(func()) | |
| 20 | + | }) *MockHistoryRepository { | |
| 21 | + | mock := &MockHistoryRepository{} | |
| 22 | + | mock.Mock.Test(t) | |
| 23 | + | ||
| 24 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| 25 | + | ||
| 26 | + | return mock | |
| 27 | + | } | |
| 28 | + | ||
| 29 | + | // MockHistoryRepository is an autogenerated mock type for the HistoryRepository type | |
| 30 | + | type MockHistoryRepository struct { | |
| 31 | + | mock.Mock | |
| 32 | + | } | |
| 33 | + | ||
| 34 | + | type MockHistoryRepository_Expecter struct { | |
| 35 | + | mock *mock.Mock | |
| 36 | + | } | |
| 37 | + | ||
| 38 | + | func (_m *MockHistoryRepository) EXPECT() *MockHistoryRepository_Expecter { | |
| 39 | + | return &MockHistoryRepository_Expecter{mock: &_m.Mock} | |
| 40 | + | } | |
| 41 | + | ||
| 42 | + | // Delete provides a mock function for the type MockHistoryRepository | |
| 43 | + | func (_mock *MockHistoryRepository) Delete(ctx context.Context, id int64) error { | |
| 44 | + | ret := _mock.Called(ctx, id) | |
| 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, int64) error); ok { | |
| 52 | + | r0 = returnFunc(ctx, id) | |
| 53 | + | } else { | |
| 54 | + | r0 = ret.Error(0) | |
| 55 | + | } | |
| 56 | + | return r0 | |
| 57 | + | } | |
| 58 | + | ||
| 59 | + | // MockHistoryRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' | |
| 60 | + | type MockHistoryRepository_Delete_Call struct { | |
| 61 | + | *mock.Call | |
| 62 | + | } | |
| 63 | + | ||
| 64 | + | // Delete is a helper method to define mock.On call | |
| 65 | + | // - ctx context.Context | |
| 66 | + | // - id int64 | |
| 67 | + | func (_e *MockHistoryRepository_Expecter) Delete(ctx interface{}, id interface{}) *MockHistoryRepository_Delete_Call { | |
| 68 | + | return &MockHistoryRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | func (_c *MockHistoryRepository_Delete_Call) Run(run func(ctx context.Context, id int64)) *MockHistoryRepository_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 int64 | |
| 78 | + | if args[1] != nil { | |
| 79 | + | arg1 = args[1].(int64) | |
| 80 | + | } | |
| 81 | + | run( | |
| 82 | + | arg0, | |
| 83 | + | arg1, | |
| 84 | + | ) | |
| 85 | + | }) | |
| 86 | + | return _c | |
| 87 | + | } | |
| 88 | + | ||
| 89 | + | func (_c *MockHistoryRepository_Delete_Call) Return(err error) *MockHistoryRepository_Delete_Call { | |
| 90 | + | _c.Call.Return(err) | |
| 91 | + | return _c | |
| 92 | + | } | |
| 93 | + | ||
| 94 | + | func (_c *MockHistoryRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, id int64) error) *MockHistoryRepository_Delete_Call { | |
| 95 | + | _c.Call.Return(run) | |
| 96 | + | return _c | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | // DeleteAll provides a mock function for the type MockHistoryRepository | |
| 100 | + | func (_mock *MockHistoryRepository) DeleteAll(ctx context.Context) error { | |
| 101 | + | ret := _mock.Called(ctx) | |
| 102 | + | ||
| 103 | + | if len(ret) == 0 { | |
| 104 | + | panic("no return value specified for DeleteAll") | |
| 105 | + | } | |
| 106 | + | ||
| 107 | + | var r0 error | |
| 108 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { | |
| 109 | + | r0 = returnFunc(ctx) | |
| 110 | + | } else { | |
| 111 | + | r0 = ret.Error(0) | |
| 112 | + | } | |
| 113 | + | return r0 | |
| 114 | + | } | |
| 115 | + | ||
| 116 | + | // MockHistoryRepository_DeleteAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteAll' | |
| 117 | + | type MockHistoryRepository_DeleteAll_Call struct { | |
| 118 | + | *mock.Call | |
| 119 | + | } | |
| 120 | + | ||
| 121 | + | // DeleteAll is a helper method to define mock.On call | |
| 122 | + | // - ctx context.Context | |
| 123 | + | func (_e *MockHistoryRepository_Expecter) DeleteAll(ctx interface{}) *MockHistoryRepository_DeleteAll_Call { | |
| 124 | + | return &MockHistoryRepository_DeleteAll_Call{Call: _e.mock.On("DeleteAll", ctx)} | |
| 125 | + | } | |
| 126 | + | ||
| 127 | + | func (_c *MockHistoryRepository_DeleteAll_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_DeleteAll_Call { | |
| 128 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 129 | + | var arg0 context.Context | |
| 130 | + | if args[0] != nil { | |
| 131 | + | arg0 = args[0].(context.Context) | |
| 132 | + | } | |
| 133 | + | run( | |
| 134 | + | arg0, | |
| 135 | + | ) | |
| 136 | + | }) | |
| 137 | + | return _c | |
| 138 | + | } | |
| 139 | + | ||
| 140 | + | func (_c *MockHistoryRepository_DeleteAll_Call) Return(err error) *MockHistoryRepository_DeleteAll_Call { | |
| 141 | + | _c.Call.Return(err) | |
| 142 | + | return _c | |
| 143 | + | } | |
| 144 | + | ||
| 145 | + | func (_c *MockHistoryRepository_DeleteAll_Call) RunAndReturn(run func(ctx context.Context) error) *MockHistoryRepository_DeleteAll_Call { | |
| 146 | + | _c.Call.Return(run) | |
| 147 | + | return _c | |
| 148 | + | } | |
| 149 | + | ||
| 150 | + | // DeleteByDomain provides a mock function for the type MockHistoryRepository | |
| 151 | + | func (_mock *MockHistoryRepository) DeleteByDomain(ctx context.Context, domain string) error { | |
| 152 | + | ret := _mock.Called(ctx, domain) | |
| 153 | + | ||
| 154 | + | if len(ret) == 0 { | |
| 155 | + | panic("no return value specified for DeleteByDomain") | |
| 156 | + | } | |
| 157 | + | ||
| 158 | + | var r0 error | |
| 159 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { | |
| 160 | + | r0 = returnFunc(ctx, domain) | |
| 161 | + | } else { | |
| 162 | + | r0 = ret.Error(0) | |
| 163 | + | } | |
| 164 | + | return r0 | |
| 165 | + | } | |
| 166 | + | ||
| 167 | + | // MockHistoryRepository_DeleteByDomain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByDomain' | |
| 168 | + | type MockHistoryRepository_DeleteByDomain_Call struct { | |
| 169 | + | *mock.Call | |
| 170 | + | } | |
| 171 | + | ||
| 172 | + | // DeleteByDomain is a helper method to define mock.On call | |
| 173 | + | // - ctx context.Context | |
| 174 | + | // - domain string | |
| 175 | + | func (_e *MockHistoryRepository_Expecter) DeleteByDomain(ctx interface{}, domain interface{}) *MockHistoryRepository_DeleteByDomain_Call { | |
| 176 | + | return &MockHistoryRepository_DeleteByDomain_Call{Call: _e.mock.On("DeleteByDomain", ctx, domain)} | |
| 177 | + | } | |
| 178 | + | ||
| 179 | + | func (_c *MockHistoryRepository_DeleteByDomain_Call) Run(run func(ctx context.Context, domain string)) *MockHistoryRepository_DeleteByDomain_Call { | |
| 180 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 181 | + | var arg0 context.Context | |
| 182 | + | if args[0] != nil { | |
| 183 | + | arg0 = args[0].(context.Context) | |
| 184 | + | } | |
| 185 | + | var arg1 string | |
| 186 | + | if args[1] != nil { | |
| 187 | + | arg1 = args[1].(string) | |
| 188 | + | } | |
| 189 | + | run( | |
| 190 | + | arg0, | |
| 191 | + | arg1, | |
| 192 | + | ) | |
| 193 | + | }) | |
| 194 | + | return _c | |
| 195 | + | } | |
| 196 | + | ||
| 197 | + | func (_c *MockHistoryRepository_DeleteByDomain_Call) Return(err error) *MockHistoryRepository_DeleteByDomain_Call { | |
| 198 | + | _c.Call.Return(err) | |
| 199 | + | return _c | |
| 200 | + | } | |
| 201 | + | ||
| 202 | + | func (_c *MockHistoryRepository_DeleteByDomain_Call) RunAndReturn(run func(ctx context.Context, domain string) error) *MockHistoryRepository_DeleteByDomain_Call { | |
| 203 | + | _c.Call.Return(run) | |
| 204 | + | return _c | |
| 205 | + | } | |
| 206 | + | ||
| 207 | + | // DeleteOlderThan provides a mock function for the type MockHistoryRepository | |
| 208 | + | func (_mock *MockHistoryRepository) DeleteOlderThan(ctx context.Context, before time.Time) error { | |
| 209 | + | ret := _mock.Called(ctx, before) | |
| 210 | + | ||
| 211 | + | if len(ret) == 0 { | |
| 212 | + | panic("no return value specified for DeleteOlderThan") | |
| 213 | + | } | |
| 214 | + | ||
| 215 | + | var r0 error | |
| 216 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time) error); ok { | |
| 217 | + | r0 = returnFunc(ctx, before) | |
| 218 | + | } else { | |
| 219 | + | r0 = ret.Error(0) | |
| 220 | + | } | |
| 221 | + | return r0 | |
| 222 | + | } | |
| 223 | + | ||
| 224 | + | // MockHistoryRepository_DeleteOlderThan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteOlderThan' | |
| 225 | + | type MockHistoryRepository_DeleteOlderThan_Call struct { | |
| 226 | + | *mock.Call | |
| 227 | + | } | |
| 228 | + | ||
| 229 | + | // DeleteOlderThan is a helper method to define mock.On call | |
| 230 | + | // - ctx context.Context | |
| 231 | + | // - before time.Time | |
| 232 | + | func (_e *MockHistoryRepository_Expecter) DeleteOlderThan(ctx interface{}, before interface{}) *MockHistoryRepository_DeleteOlderThan_Call { | |
| 233 | + | return &MockHistoryRepository_DeleteOlderThan_Call{Call: _e.mock.On("DeleteOlderThan", ctx, before)} | |
| 234 | + | } | |
| 235 | + | ||
| 236 | + | func (_c *MockHistoryRepository_DeleteOlderThan_Call) Run(run func(ctx context.Context, before time.Time)) *MockHistoryRepository_DeleteOlderThan_Call { | |
| 237 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 238 | + | var arg0 context.Context | |
| 239 | + | if args[0] != nil { | |
| 240 | + | arg0 = args[0].(context.Context) | |
| 241 | + | } | |
| 242 | + | var arg1 time.Time | |
| 243 | + | if args[1] != nil { | |
| 244 | + | arg1 = args[1].(time.Time) | |
| 245 | + | } | |
| 246 | + | run( | |
| 247 | + | arg0, | |
| 248 | + | arg1, | |
| 249 | + | ) | |
| 250 | + | }) | |
| 251 | + | return _c | |
| 252 | + | } | |
| 253 | + | ||
| 254 | + | func (_c *MockHistoryRepository_DeleteOlderThan_Call) Return(err error) *MockHistoryRepository_DeleteOlderThan_Call { | |
| 255 | + | _c.Call.Return(err) | |
| 256 | + | return _c | |
| 257 | + | } | |
| 258 | + | ||
| 259 | + | func (_c *MockHistoryRepository_DeleteOlderThan_Call) RunAndReturn(run func(ctx context.Context, before time.Time) error) *MockHistoryRepository_DeleteOlderThan_Call { | |
| 260 | + | _c.Call.Return(run) | |
| 261 | + | return _c | |
| 262 | + | } | |
| 263 | + | ||
| 264 | + | // FindByURL provides a mock function for the type MockHistoryRepository | |
| 265 | + | func (_mock *MockHistoryRepository) FindByURL(ctx context.Context, url string) (*entity.HistoryEntry, error) { | |
| 266 | + | ret := _mock.Called(ctx, url) | |
| 267 | + | ||
| 268 | + | if len(ret) == 0 { | |
| 269 | + | panic("no return value specified for FindByURL") | |
| 270 | + | } | |
| 271 | + | ||
| 272 | + | var r0 *entity.HistoryEntry | |
| 273 | + | var r1 error | |
| 274 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*entity.HistoryEntry, error)); ok { | |
| 275 | + | return returnFunc(ctx, url) | |
| 276 | + | } | |
| 277 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) *entity.HistoryEntry); ok { | |
| 278 | + | r0 = returnFunc(ctx, url) | |
| 279 | + | } else { | |
| 280 | + | if ret.Get(0) != nil { | |
| 281 | + | r0 = ret.Get(0).(*entity.HistoryEntry) | |
| 282 | + | } | |
| 283 | + | } | |
| 284 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { | |
| 285 | + | r1 = returnFunc(ctx, url) | |
| 286 | + | } else { | |
| 287 | + | r1 = ret.Error(1) | |
| 288 | + | } | |
| 289 | + | return r0, r1 | |
| 290 | + | } | |
| 291 | + | ||
| 292 | + | // MockHistoryRepository_FindByURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByURL' | |
| 293 | + | type MockHistoryRepository_FindByURL_Call struct { | |
| 294 | + | *mock.Call | |
| 295 | + | } | |
| 296 | + | ||
| 297 | + | // FindByURL is a helper method to define mock.On call | |
| 298 | + | // - ctx context.Context | |
| 299 | + | // - url string | |
| 300 | + | func (_e *MockHistoryRepository_Expecter) FindByURL(ctx interface{}, url interface{}) *MockHistoryRepository_FindByURL_Call { | |
| 301 | + | return &MockHistoryRepository_FindByURL_Call{Call: _e.mock.On("FindByURL", ctx, url)} | |
| 302 | + | } | |
| 303 | + | ||
| 304 | + | func (_c *MockHistoryRepository_FindByURL_Call) Run(run func(ctx context.Context, url string)) *MockHistoryRepository_FindByURL_Call { | |
| 305 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 306 | + | var arg0 context.Context | |
| 307 | + | if args[0] != nil { | |
| 308 | + | arg0 = args[0].(context.Context) | |
| 309 | + | } | |
| 310 | + | var arg1 string | |
| 311 | + | if args[1] != nil { | |
| 312 | + | arg1 = args[1].(string) | |
| 313 | + | } | |
| 314 | + | run( | |
| 315 | + | arg0, | |
| 316 | + | arg1, | |
| 317 | + | ) | |
| 318 | + | }) | |
| 319 | + | return _c | |
| 320 | + | } | |
| 321 | + | ||
| 322 | + | func (_c *MockHistoryRepository_FindByURL_Call) Return(historyEntry *entity.HistoryEntry, err error) *MockHistoryRepository_FindByURL_Call { | |
| 323 | + | _c.Call.Return(historyEntry, err) | |
| 324 | + | return _c | |
| 325 | + | } | |
| 326 | + | ||
| 327 | + | func (_c *MockHistoryRepository_FindByURL_Call) RunAndReturn(run func(ctx context.Context, url string) (*entity.HistoryEntry, error)) *MockHistoryRepository_FindByURL_Call { | |
| 328 | + | _c.Call.Return(run) | |
| 329 | + | return _c | |
| 330 | + | } | |
| 331 | + | ||
| 332 | + | // GetDailyVisitCount provides a mock function for the type MockHistoryRepository | |
| 333 | + | func (_mock *MockHistoryRepository) GetDailyVisitCount(ctx context.Context, daysAgo string) ([]*entity.DailyVisitCount, error) { | |
| 334 | + | ret := _mock.Called(ctx, daysAgo) | |
| 335 | + | ||
| 336 | + | if len(ret) == 0 { | |
| 337 | + | panic("no return value specified for GetDailyVisitCount") | |
| 338 | + | } | |
| 339 | + | ||
| 340 | + | var r0 []*entity.DailyVisitCount | |
| 341 | + | var r1 error | |
| 342 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]*entity.DailyVisitCount, error)); ok { | |
| 343 | + | return returnFunc(ctx, daysAgo) | |
| 344 | + | } | |
| 345 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) []*entity.DailyVisitCount); ok { | |
| 346 | + | r0 = returnFunc(ctx, daysAgo) | |
| 347 | + | } else { | |
| 348 | + | if ret.Get(0) != nil { | |
| 349 | + | r0 = ret.Get(0).([]*entity.DailyVisitCount) | |
| 350 | + | } | |
| 351 | + | } | |
| 352 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { | |
| 353 | + | r1 = returnFunc(ctx, daysAgo) | |
| 354 | + | } else { | |
| 355 | + | r1 = ret.Error(1) | |
| 356 | + | } | |
| 357 | + | return r0, r1 | |
| 358 | + | } | |
| 359 | + | ||
| 360 | + | // MockHistoryRepository_GetDailyVisitCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDailyVisitCount' | |
| 361 | + | type MockHistoryRepository_GetDailyVisitCount_Call struct { | |
| 362 | + | *mock.Call | |
| 363 | + | } | |
| 364 | + | ||
| 365 | + | // GetDailyVisitCount is a helper method to define mock.On call | |
| 366 | + | // - ctx context.Context | |
| 367 | + | // - daysAgo string | |
| 368 | + | func (_e *MockHistoryRepository_Expecter) GetDailyVisitCount(ctx interface{}, daysAgo interface{}) *MockHistoryRepository_GetDailyVisitCount_Call { | |
| 369 | + | return &MockHistoryRepository_GetDailyVisitCount_Call{Call: _e.mock.On("GetDailyVisitCount", ctx, daysAgo)} | |
| 370 | + | } | |
| 371 | + | ||
| 372 | + | func (_c *MockHistoryRepository_GetDailyVisitCount_Call) Run(run func(ctx context.Context, daysAgo string)) *MockHistoryRepository_GetDailyVisitCount_Call { | |
| 373 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 374 | + | var arg0 context.Context | |
| 375 | + | if args[0] != nil { | |
| 376 | + | arg0 = args[0].(context.Context) | |
| 377 | + | } | |
| 378 | + | var arg1 string | |
| 379 | + | if args[1] != nil { | |
| 380 | + | arg1 = args[1].(string) | |
| 381 | + | } | |
| 382 | + | run( | |
| 383 | + | arg0, | |
| 384 | + | arg1, | |
| 385 | + | ) | |
| 386 | + | }) | |
| 387 | + | return _c | |
| 388 | + | } | |
| 389 | + | ||
| 390 | + | func (_c *MockHistoryRepository_GetDailyVisitCount_Call) Return(dailyVisitCounts []*entity.DailyVisitCount, err error) *MockHistoryRepository_GetDailyVisitCount_Call { | |
| 391 | + | _c.Call.Return(dailyVisitCounts, err) | |
| 392 | + | return _c | |
| 393 | + | } | |
| 394 | + | ||
| 395 | + | func (_c *MockHistoryRepository_GetDailyVisitCount_Call) RunAndReturn(run func(ctx context.Context, daysAgo string) ([]*entity.DailyVisitCount, error)) *MockHistoryRepository_GetDailyVisitCount_Call { | |
| 396 | + | _c.Call.Return(run) | |
| 397 | + | return _c | |
| 398 | + | } | |
| 399 | + | ||
| 400 | + | // GetDomainStats provides a mock function for the type MockHistoryRepository | |
| 401 | + | func (_mock *MockHistoryRepository) GetDomainStats(ctx context.Context, limit int) ([]*entity.DomainStat, error) { | |
| 402 | + | ret := _mock.Called(ctx, limit) | |
| 403 | + | ||
| 404 | + | if len(ret) == 0 { | |
| 405 | + | panic("no return value specified for GetDomainStats") | |
| 406 | + | } | |
| 407 | + | ||
| 408 | + | var r0 []*entity.DomainStat | |
| 409 | + | var r1 error | |
| 410 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, int) ([]*entity.DomainStat, error)); ok { | |
| 411 | + | return returnFunc(ctx, limit) | |
| 412 | + | } | |
| 413 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, int) []*entity.DomainStat); ok { | |
| 414 | + | r0 = returnFunc(ctx, limit) | |
| 415 | + | } else { | |
| 416 | + | if ret.Get(0) != nil { | |
| 417 | + | r0 = ret.Get(0).([]*entity.DomainStat) | |
| 418 | + | } | |
| 419 | + | } | |
| 420 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, int) error); ok { | |
| 421 | + | r1 = returnFunc(ctx, limit) | |
| 422 | + | } else { | |
| 423 | + | r1 = ret.Error(1) | |
| 424 | + | } | |
| 425 | + | return r0, r1 | |
| 426 | + | } | |
| 427 | + | ||
| 428 | + | // MockHistoryRepository_GetDomainStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDomainStats' | |
| 429 | + | type MockHistoryRepository_GetDomainStats_Call struct { | |
| 430 | + | *mock.Call | |
| 431 | + | } | |
| 432 | + | ||
| 433 | + | // GetDomainStats is a helper method to define mock.On call | |
| 434 | + | // - ctx context.Context | |
| 435 | + | // - limit int | |
| 436 | + | func (_e *MockHistoryRepository_Expecter) GetDomainStats(ctx interface{}, limit interface{}) *MockHistoryRepository_GetDomainStats_Call { | |
| 437 | + | return &MockHistoryRepository_GetDomainStats_Call{Call: _e.mock.On("GetDomainStats", ctx, limit)} | |
| 438 | + | } | |
| 439 | + | ||
| 440 | + | func (_c *MockHistoryRepository_GetDomainStats_Call) Run(run func(ctx context.Context, limit int)) *MockHistoryRepository_GetDomainStats_Call { | |
| 441 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 442 | + | var arg0 context.Context | |
| 443 | + | if args[0] != nil { | |
| 444 | + | arg0 = args[0].(context.Context) | |
| 445 | + | } | |
| 446 | + | var arg1 int | |
| 447 | + | if args[1] != nil { | |
| 448 | + | arg1 = args[1].(int) | |
| 449 | + | } | |
| 450 | + | run( | |
| 451 | + | arg0, | |
| 452 | + | arg1, | |
| 453 | + | ) | |
| 454 | + | }) | |
| 455 | + | return _c | |
| 456 | + | } | |
| 457 | + | ||
| 458 | + | func (_c *MockHistoryRepository_GetDomainStats_Call) Return(domainStats []*entity.DomainStat, err error) *MockHistoryRepository_GetDomainStats_Call { | |
| 459 | + | _c.Call.Return(domainStats, err) | |
| 460 | + | return _c | |
| 461 | + | } | |
| 462 | + | ||
| 463 | + | func (_c *MockHistoryRepository_GetDomainStats_Call) RunAndReturn(run func(ctx context.Context, limit int) ([]*entity.DomainStat, error)) *MockHistoryRepository_GetDomainStats_Call { | |
| 464 | + | _c.Call.Return(run) | |
| 465 | + | return _c | |
| 466 | + | } | |
| 467 | + | ||
| 468 | + | // GetHourlyDistribution provides a mock function for the type MockHistoryRepository | |
| 469 | + | func (_mock *MockHistoryRepository) GetHourlyDistribution(ctx context.Context) ([]*entity.HourlyDistribution, error) { | |
| 470 | + | ret := _mock.Called(ctx) | |
| 471 | + | ||
| 472 | + | if len(ret) == 0 { | |
| 473 | + | panic("no return value specified for GetHourlyDistribution") | |
| 474 | + | } | |
| 475 | + | ||
| 476 | + | var r0 []*entity.HourlyDistribution | |
| 477 | + | var r1 error | |
| 478 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.HourlyDistribution, error)); ok { | |
| 479 | + | return returnFunc(ctx) | |
| 480 | + | } | |
| 481 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.HourlyDistribution); ok { | |
| 482 | + | r0 = returnFunc(ctx) | |
| 483 | + | } else { | |
| 484 | + | if ret.Get(0) != nil { | |
| 485 | + | r0 = ret.Get(0).([]*entity.HourlyDistribution) | |
| 486 | + | } | |
| 487 | + | } | |
| 488 | + | if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { | |
| 489 | + | r1 = returnFunc(ctx) | |
| 490 | + | } else { | |
| 491 | + | r1 = ret.Error(1) | |
| 492 | + | } | |
| 493 | + | return r0, r1 | |
| 494 | + | } | |
| 495 | + | ||
| 496 | + | // MockHistoryRepository_GetHourlyDistribution_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHourlyDistribution' | |
| 497 | + | type MockHistoryRepository_GetHourlyDistribution_Call struct { | |
| 498 | + | *mock.Call | |
| 499 | + | } | |
| 500 | + | ||
| 501 | + | // GetHourlyDistribution is a helper method to define mock.On call | |
| 502 | + | // - ctx context.Context | |
| 503 | + | func (_e *MockHistoryRepository_Expecter) GetHourlyDistribution(ctx interface{}) *MockHistoryRepository_GetHourlyDistribution_Call { | |
| 504 | + | return &MockHistoryRepository_GetHourlyDistribution_Call{Call: _e.mock.On("GetHourlyDistribution", ctx)} | |
| 505 | + | } | |
| 506 | + | ||
| 507 | + | func (_c *MockHistoryRepository_GetHourlyDistribution_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_GetHourlyDistribution_Call { | |
| 508 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 509 | + | var arg0 context.Context | |
| 510 | + | if args[0] != nil { | |
| 511 | + | arg0 = args[0].(context.Context) | |
| 512 | + | } | |
| 513 | + | run( | |
| 514 | + | arg0, | |
| 515 | + | ) | |
| 516 | + | }) | |
| 517 | + | return _c | |
| 518 | + | } | |
| 519 | + | ||
| 520 | + | func (_c *MockHistoryRepository_GetHourlyDistribution_Call) Return(hourlyDistributions []*entity.HourlyDistribution, err error) *MockHistoryRepository_GetHourlyDistribution_Call { | |
| 521 | + | _c.Call.Return(hourlyDistributions, err) | |
| 522 | + | return _c | |
| 523 | + | } | |
| 524 | + | ||
| 525 | + | func (_c *MockHistoryRepository_GetHourlyDistribution_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.HourlyDistribution, error)) *MockHistoryRepository_GetHourlyDistribution_Call { | |
| 526 | + | _c.Call.Return(run) | |
| 527 | + | return _c | |
| 528 | + | } | |
| 529 | + | ||
| 530 | + | // GetRecent provides a mock function for the type MockHistoryRepository | |
| 531 | + | func (_mock *MockHistoryRepository) GetRecent(ctx context.Context, limit int, offset int) ([]*entity.HistoryEntry, error) { | |
| 532 | + | ret := _mock.Called(ctx, limit, offset) | |
| 533 | + | ||
| 534 | + | if len(ret) == 0 { | |
| 535 | + | panic("no return value specified for GetRecent") | |
| 536 | + | } | |
| 537 | + | ||
| 538 | + | var r0 []*entity.HistoryEntry | |
| 539 | + | var r1 error | |
| 540 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, int, int) ([]*entity.HistoryEntry, error)); ok { | |
| 541 | + | return returnFunc(ctx, limit, offset) | |
| 542 | + | } | |
| 543 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, int, int) []*entity.HistoryEntry); ok { | |
| 544 | + | r0 = returnFunc(ctx, limit, offset) | |
| 545 | + | } else { | |
| 546 | + | if ret.Get(0) != nil { | |
| 547 | + | r0 = ret.Get(0).([]*entity.HistoryEntry) | |
| 548 | + | } | |
| 549 | + | } | |
| 550 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, int, int) error); ok { | |
| 551 | + | r1 = returnFunc(ctx, limit, offset) | |
| 552 | + | } else { | |
| 553 | + | r1 = ret.Error(1) | |
| 554 | + | } | |
| 555 | + | return r0, r1 | |
| 556 | + | } | |
| 557 | + | ||
| 558 | + | // MockHistoryRepository_GetRecent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRecent' | |
| 559 | + | type MockHistoryRepository_GetRecent_Call struct { | |
| 560 | + | *mock.Call | |
| 561 | + | } | |
| 562 | + | ||
| 563 | + | // GetRecent is a helper method to define mock.On call | |
| 564 | + | // - ctx context.Context | |
| 565 | + | // - limit int | |
| 566 | + | // - offset int | |
| 567 | + | func (_e *MockHistoryRepository_Expecter) GetRecent(ctx interface{}, limit interface{}, offset interface{}) *MockHistoryRepository_GetRecent_Call { | |
| 568 | + | return &MockHistoryRepository_GetRecent_Call{Call: _e.mock.On("GetRecent", ctx, limit, offset)} | |
| 569 | + | } | |
| 570 | + | ||
| 571 | + | func (_c *MockHistoryRepository_GetRecent_Call) Run(run func(ctx context.Context, limit int, offset int)) *MockHistoryRepository_GetRecent_Call { | |
| 572 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 573 | + | var arg0 context.Context | |
| 574 | + | if args[0] != nil { | |
| 575 | + | arg0 = args[0].(context.Context) | |
| 576 | + | } | |
| 577 | + | var arg1 int | |
| 578 | + | if args[1] != nil { | |
| 579 | + | arg1 = args[1].(int) | |
| 580 | + | } | |
| 581 | + | var arg2 int | |
| 582 | + | if args[2] != nil { | |
| 583 | + | arg2 = args[2].(int) | |
| 584 | + | } | |
| 585 | + | run( | |
| 586 | + | arg0, | |
| 587 | + | arg1, | |
| 588 | + | arg2, | |
| 589 | + | ) | |
| 590 | + | }) | |
| 591 | + | return _c | |
| 592 | + | } | |
| 593 | + | ||
| 594 | + | func (_c *MockHistoryRepository_GetRecent_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetRecent_Call { | |
| 595 | + | _c.Call.Return(historyEntrys, err) | |
| 596 | + | return _c | |
| 597 | + | } | |
| 598 | + | ||
| 599 | + | func (_c *MockHistoryRepository_GetRecent_Call) RunAndReturn(run func(ctx context.Context, limit int, offset int) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetRecent_Call { | |
| 600 | + | _c.Call.Return(run) | |
| 601 | + | return _c | |
| 602 | + | } | |
| 603 | + | ||
| 604 | + | // GetStats provides a mock function for the type MockHistoryRepository | |
| 605 | + | func (_mock *MockHistoryRepository) GetStats(ctx context.Context) (*entity.HistoryStats, error) { | |
| 606 | + | ret := _mock.Called(ctx) | |
| 607 | + | ||
| 608 | + | if len(ret) == 0 { | |
| 609 | + | panic("no return value specified for GetStats") | |
| 610 | + | } | |
| 611 | + | ||
| 612 | + | var r0 *entity.HistoryStats | |
| 613 | + | var r1 error | |
| 614 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) (*entity.HistoryStats, error)); ok { | |
| 615 | + | return returnFunc(ctx) | |
| 616 | + | } | |
| 617 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) *entity.HistoryStats); ok { | |
| 618 | + | r0 = returnFunc(ctx) | |
| 619 | + | } else { | |
| 620 | + | if ret.Get(0) != nil { | |
| 621 | + | r0 = ret.Get(0).(*entity.HistoryStats) | |
| 622 | + | } | |
| 623 | + | } | |
| 624 | + | if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { | |
| 625 | + | r1 = returnFunc(ctx) | |
| 626 | + | } else { | |
| 627 | + | r1 = ret.Error(1) | |
| 628 | + | } | |
| 629 | + | return r0, r1 | |
| 630 | + | } | |
| 631 | + | ||
| 632 | + | // MockHistoryRepository_GetStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStats' | |
| 633 | + | type MockHistoryRepository_GetStats_Call struct { | |
| 634 | + | *mock.Call | |
| 635 | + | } | |
| 636 | + | ||
| 637 | + | // GetStats is a helper method to define mock.On call | |
| 638 | + | // - ctx context.Context | |
| 639 | + | func (_e *MockHistoryRepository_Expecter) GetStats(ctx interface{}) *MockHistoryRepository_GetStats_Call { | |
| 640 | + | return &MockHistoryRepository_GetStats_Call{Call: _e.mock.On("GetStats", ctx)} | |
| 641 | + | } | |
| 642 | + | ||
| 643 | + | func (_c *MockHistoryRepository_GetStats_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_GetStats_Call { | |
| 644 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 645 | + | var arg0 context.Context | |
| 646 | + | if args[0] != nil { | |
| 647 | + | arg0 = args[0].(context.Context) | |
| 648 | + | } | |
| 649 | + | run( | |
| 650 | + | arg0, | |
| 651 | + | ) | |
| 652 | + | }) | |
| 653 | + | return _c | |
| 654 | + | } | |
| 655 | + | ||
| 656 | + | func (_c *MockHistoryRepository_GetStats_Call) Return(historyStats *entity.HistoryStats, err error) *MockHistoryRepository_GetStats_Call { | |
| 657 | + | _c.Call.Return(historyStats, err) | |
| 658 | + | return _c | |
| 659 | + | } | |
| 660 | + | ||
| 661 | + | func (_c *MockHistoryRepository_GetStats_Call) RunAndReturn(run func(ctx context.Context) (*entity.HistoryStats, error)) *MockHistoryRepository_GetStats_Call { | |
| 662 | + | _c.Call.Return(run) | |
| 663 | + | return _c | |
| 664 | + | } | |
| 665 | + | ||
| 666 | + | // IncrementVisitCount provides a mock function for the type MockHistoryRepository | |
| 667 | + | func (_mock *MockHistoryRepository) IncrementVisitCount(ctx context.Context, url string) error { | |
| 668 | + | ret := _mock.Called(ctx, url) | |
| 669 | + | ||
| 670 | + | if len(ret) == 0 { | |
| 671 | + | panic("no return value specified for IncrementVisitCount") | |
| 672 | + | } | |
| 673 | + | ||
| 674 | + | var r0 error | |
| 675 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { | |
| 676 | + | r0 = returnFunc(ctx, url) | |
| 677 | + | } else { | |
| 678 | + | r0 = ret.Error(0) | |
| 679 | + | } | |
| 680 | + | return r0 | |
| 681 | + | } | |
| 682 | + | ||
| 683 | + | // MockHistoryRepository_IncrementVisitCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncrementVisitCount' | |
| 684 | + | type MockHistoryRepository_IncrementVisitCount_Call struct { | |
| 685 | + | *mock.Call | |
| 686 | + | } | |
| 687 | + | ||
| 688 | + | // IncrementVisitCount is a helper method to define mock.On call | |
| 689 | + | // - ctx context.Context | |
| 690 | + | // - url string | |
| 691 | + | func (_e *MockHistoryRepository_Expecter) IncrementVisitCount(ctx interface{}, url interface{}) *MockHistoryRepository_IncrementVisitCount_Call { | |
| 692 | + | return &MockHistoryRepository_IncrementVisitCount_Call{Call: _e.mock.On("IncrementVisitCount", ctx, url)} | |
| 693 | + | } | |
| 694 | + | ||
| 695 | + | func (_c *MockHistoryRepository_IncrementVisitCount_Call) Run(run func(ctx context.Context, url string)) *MockHistoryRepository_IncrementVisitCount_Call { | |
| 696 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 697 | + | var arg0 context.Context | |
| 698 | + | if args[0] != nil { | |
| 699 | + | arg0 = args[0].(context.Context) | |
| 700 | + | } | |
| 701 | + | var arg1 string | |
| 702 | + | if args[1] != nil { | |
| 703 | + | arg1 = args[1].(string) | |
| 704 | + | } | |
| 705 | + | run( | |
| 706 | + | arg0, | |
| 707 | + | arg1, | |
| 708 | + | ) | |
| 709 | + | }) | |
| 710 | + | return _c | |
| 711 | + | } | |
| 712 | + | ||
| 713 | + | func (_c *MockHistoryRepository_IncrementVisitCount_Call) Return(err error) *MockHistoryRepository_IncrementVisitCount_Call { | |
| 714 | + | _c.Call.Return(err) | |
| 715 | + | return _c | |
| 716 | + | } | |
| 717 | + | ||
| 718 | + | func (_c *MockHistoryRepository_IncrementVisitCount_Call) RunAndReturn(run func(ctx context.Context, url string) error) *MockHistoryRepository_IncrementVisitCount_Call { | |
| 719 | + | _c.Call.Return(run) | |
| 720 | + | return _c | |
| 721 | + | } | |
| 722 | + | ||
| 723 | + | // Save provides a mock function for the type MockHistoryRepository | |
| 724 | + | func (_mock *MockHistoryRepository) Save(ctx context.Context, entry *entity.HistoryEntry) error { | |
| 725 | + | ret := _mock.Called(ctx, entry) | |
| 726 | + | ||
| 727 | + | if len(ret) == 0 { | |
| 728 | + | panic("no return value specified for Save") | |
| 729 | + | } | |
| 730 | + | ||
| 731 | + | var r0 error | |
| 732 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.HistoryEntry) error); ok { | |
| 733 | + | r0 = returnFunc(ctx, entry) | |
| 734 | + | } else { | |
| 735 | + | r0 = ret.Error(0) | |
| 736 | + | } | |
| 737 | + | return r0 | |
| 738 | + | } | |
| 739 | + | ||
| 740 | + | // MockHistoryRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' | |
| 741 | + | type MockHistoryRepository_Save_Call struct { | |
| 742 | + | *mock.Call | |
| 743 | + | } | |
| 744 | + | ||
| 745 | + | // Save is a helper method to define mock.On call | |
| 746 | + | // - ctx context.Context | |
| 747 | + | // - entry *entity.HistoryEntry | |
| 748 | + | func (_e *MockHistoryRepository_Expecter) Save(ctx interface{}, entry interface{}) *MockHistoryRepository_Save_Call { | |
| 749 | + | return &MockHistoryRepository_Save_Call{Call: _e.mock.On("Save", ctx, entry)} | |
| 750 | + | } | |
| 751 | + | ||
| 752 | + | func (_c *MockHistoryRepository_Save_Call) Run(run func(ctx context.Context, entry *entity.HistoryEntry)) *MockHistoryRepository_Save_Call { | |
| 753 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 754 | + | var arg0 context.Context | |
| 755 | + | if args[0] != nil { | |
| 756 | + | arg0 = args[0].(context.Context) | |
| 757 | + | } | |
| 758 | + | var arg1 *entity.HistoryEntry | |
| 759 | + | if args[1] != nil { | |
| 760 | + | arg1 = args[1].(*entity.HistoryEntry) | |
| 761 | + | } | |
| 762 | + | run( | |
| 763 | + | arg0, | |
| 764 | + | arg1, | |
| 765 | + | ) | |
| 766 | + | }) | |
| 767 | + | return _c | |
| 768 | + | } | |
| 769 | + | ||
| 770 | + | func (_c *MockHistoryRepository_Save_Call) Return(err error) *MockHistoryRepository_Save_Call { | |
| 771 | + | _c.Call.Return(err) | |
| 772 | + | return _c | |
| 773 | + | } | |
| 774 | + | ||
| 775 | + | func (_c *MockHistoryRepository_Save_Call) RunAndReturn(run func(ctx context.Context, entry *entity.HistoryEntry) error) *MockHistoryRepository_Save_Call { | |
| 776 | + | _c.Call.Return(run) | |
| 777 | + | return _c | |
| 778 | + | } | |
| 779 | + | ||
| 780 | + | // Search provides a mock function for the type MockHistoryRepository | |
| 781 | + | func (_mock *MockHistoryRepository) Search(ctx context.Context, query string, limit int) ([]entity.HistoryMatch, error) { | |
| 782 | + | ret := _mock.Called(ctx, query, limit) | |
| 783 | + | ||
| 784 | + | if len(ret) == 0 { | |
| 785 | + | panic("no return value specified for Search") | |
| 786 | + | } | |
| 787 | + | ||
| 788 | + | var r0 []entity.HistoryMatch | |
| 789 | + | var r1 error | |
| 790 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string, int) ([]entity.HistoryMatch, error)); ok { | |
| 791 | + | return returnFunc(ctx, query, limit) | |
| 792 | + | } | |
| 793 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string, int) []entity.HistoryMatch); ok { | |
| 794 | + | r0 = returnFunc(ctx, query, limit) | |
| 795 | + | } else { | |
| 796 | + | if ret.Get(0) != nil { | |
| 797 | + | r0 = ret.Get(0).([]entity.HistoryMatch) | |
| 798 | + | } | |
| 799 | + | } | |
| 800 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, string, int) error); ok { | |
| 801 | + | r1 = returnFunc(ctx, query, limit) | |
| 802 | + | } else { | |
| 803 | + | r1 = ret.Error(1) | |
| 804 | + | } | |
| 805 | + | return r0, r1 | |
| 806 | + | } | |
| 807 | + | ||
| 808 | + | // MockHistoryRepository_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search' | |
| 809 | + | type MockHistoryRepository_Search_Call struct { | |
| 810 | + | *mock.Call | |
| 811 | + | } | |
| 812 | + | ||
| 813 | + | // Search is a helper method to define mock.On call | |
| 814 | + | // - ctx context.Context | |
| 815 | + | // - query string | |
| 816 | + | // - limit int | |
| 817 | + | func (_e *MockHistoryRepository_Expecter) Search(ctx interface{}, query interface{}, limit interface{}) *MockHistoryRepository_Search_Call { | |
| 818 | + | return &MockHistoryRepository_Search_Call{Call: _e.mock.On("Search", ctx, query, limit)} | |
| 819 | + | } | |
| 820 | + | ||
| 821 | + | func (_c *MockHistoryRepository_Search_Call) Run(run func(ctx context.Context, query string, limit int)) *MockHistoryRepository_Search_Call { | |
| 822 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 823 | + | var arg0 context.Context | |
| 824 | + | if args[0] != nil { | |
| 825 | + | arg0 = args[0].(context.Context) | |
| 826 | + | } | |
| 827 | + | var arg1 string | |
| 828 | + | if args[1] != nil { | |
| 829 | + | arg1 = args[1].(string) | |
| 830 | + | } | |
| 831 | + | var arg2 int | |
| 832 | + | if args[2] != nil { | |
| 833 | + | arg2 = args[2].(int) | |
| 834 | + | } | |
| 835 | + | run( | |
| 836 | + | arg0, | |
| 837 | + | arg1, | |
| 838 | + | arg2, | |
| 839 | + | ) | |
| 840 | + | }) | |
| 841 | + | return _c | |
| 842 | + | } | |
| 843 | + | ||
| 844 | + | func (_c *MockHistoryRepository_Search_Call) Return(historyMatchs []entity.HistoryMatch, err error) *MockHistoryRepository_Search_Call { | |
| 845 | + | _c.Call.Return(historyMatchs, err) | |
| 846 | + | return _c | |
| 847 | + | } | |
| 848 | + | ||
| 849 | + | func (_c *MockHistoryRepository_Search_Call) RunAndReturn(run func(ctx context.Context, query string, limit int) ([]entity.HistoryMatch, error)) *MockHistoryRepository_Search_Call { | |
| 850 | + | _c.Call.Return(run) | |
| 851 | + | return _c | |
| 852 | + | } | |
| @@ -0,0 +1,852 @@ | |||||
| 1 | + | // Code generated by mockery; DO NOT EDIT. | |||
| 2 | + | // github.com/vektra/mockery | |||
| 3 | + | // template: testify | |||
| 4 | + | ||||
| 5 | + | package mocks | |||
| 6 | + | ||||
| 7 | + | import ( | |||
| 8 | + | "context" | |||
| 9 | + | "time" | |||
| 10 | + | ||||
| 11 | + | "github.com/bnema/dumber/internal/domain/entity" | |||
| 12 | + | mock "github.com/stretchr/testify/mock" | |||
| 13 | + | ) | |||
| 14 | + | ||||
| 15 | + | // NewMockHistoryRepository creates a new instance of MockHistoryRepository. 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. | |||
| 17 | + | func NewMockHistoryRepository(t interface { | |||
| 18 | + | mock.TestingT | |||
| 19 | + | Cleanup(func()) | |||
| 20 | + | }) *MockHistoryRepository { | |||
| 21 | + | mock := &MockHistoryRepository{} | |||
| 22 | + | mock.Mock.Test(t) | |||
| 23 | + | ||||
| 24 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |||
| 25 | + | ||||
| 26 | + | return mock | |||
| 27 | + | } | |||
| 28 | + | ||||
| 29 | + | // MockHistoryRepository is an autogenerated mock type for the HistoryRepository type | |||
| 30 | + | type MockHistoryRepository struct { | |||
| 31 | + | mock.Mock | |||
| 32 | + | } | |||
| 33 | + | ||||
| 34 | + | type MockHistoryRepository_Expecter struct { | |||
| 35 | + | mock *mock.Mock | |||
| 36 | + | } | |||
| 37 | + | ||||
| 38 | + | func (_m *MockHistoryRepository) EXPECT() *MockHistoryRepository_Expecter { | |||
| 39 | + | return &MockHistoryRepository_Expecter{mock: &_m.Mock} | |||
| 40 | + | } | |||
| 41 | + | ||||
| 42 | + | // Delete provides a mock function for the type MockHistoryRepository | |||
| 43 | + | func (_mock *MockHistoryRepository) Delete(ctx context.Context, id int64) error { | |||
| 44 | + | ret := _mock.Called(ctx, id) | |||
| 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, int64) error); ok { | |||
| 52 | + | r0 = returnFunc(ctx, id) | |||
| 53 | + | } else { | |||
| 54 | + | r0 = ret.Error(0) | |||
| 55 | + | } | |||
| 56 | + | return r0 | |||
| 57 | + | } | |||
| 58 | + | ||||
| 59 | + | // MockHistoryRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' | |||
| 60 | + | type MockHistoryRepository_Delete_Call struct { | |||
| 61 | + | *mock.Call | |||
| 62 | + | } | |||
| 63 | + | ||||
| 64 | + | // Delete is a helper method to define mock.On call | |||
| 65 | + | // - ctx context.Context | |||
| 66 | + | // - id int64 | |||
| 67 | + | func (_e *MockHistoryRepository_Expecter) Delete(ctx interface{}, id interface{}) *MockHistoryRepository_Delete_Call { | |||
| 68 | + | return &MockHistoryRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} | |||
| 69 | + | } | |||
| 70 | + | ||||
| 71 | + | func (_c *MockHistoryRepository_Delete_Call) Run(run func(ctx context.Context, id int64)) *MockHistoryRepository_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 int64 | |||
| 78 | + | if args[1] != nil { | |||
| 79 | + | arg1 = args[1].(int64) | |||
| 80 | + | } | |||
| 81 | + | run( | |||
| 82 | + | arg0, | |||
| 83 | + | arg1, | |||
| 84 | + | ) | |||
| 85 | + | }) | |||
| 86 | + | return _c | |||
| 87 | + | } | |||
| 88 | + | ||||
| 89 | + | func (_c *MockHistoryRepository_Delete_Call) Return(err error) *MockHistoryRepository_Delete_Call { | |||
| 90 | + | _c.Call.Return(err) | |||
| 91 | + | return _c | |||
| 92 | + | } | |||
| 93 | + | ||||
| 94 | + | func (_c *MockHistoryRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, id int64) error) *MockHistoryRepository_Delete_Call { | |||
| 95 | + | _c.Call.Return(run) | |||
| 96 | + | return _c | |||
| 97 | + | } | |||
| 98 | + | ||||
| 99 | + | // DeleteAll provides a mock function for the type MockHistoryRepository | |||
| 100 | + | func (_mock *MockHistoryRepository) DeleteAll(ctx context.Context) error { | |||
| 101 | + | ret := _mock.Called(ctx) | |||
| 102 | + | ||||
| 103 | + | if len(ret) == 0 { | |||
| 104 | + | panic("no return value specified for DeleteAll") | |||
| 105 | + | } | |||
| 106 | + | ||||
| 107 | + | var r0 error | |||
| 108 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { | |||
| 109 | + | r0 = returnFunc(ctx) | |||
| 110 | + | } else { | |||
| 111 | + | r0 = ret.Error(0) | |||
| 112 | + | } | |||
| 113 | + | return r0 | |||
| 114 | + | } | |||
| 115 | + | ||||
| 116 | + | // MockHistoryRepository_DeleteAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteAll' | |||
| 117 | + | type MockHistoryRepository_DeleteAll_Call struct { | |||
| 118 | + | *mock.Call | |||
| 119 | + | } | |||
| 120 | + | ||||
| 121 | + | // DeleteAll is a helper method to define mock.On call | |||
| 122 | + | // - ctx context.Context | |||
| 123 | + | func (_e *MockHistoryRepository_Expecter) DeleteAll(ctx interface{}) *MockHistoryRepository_DeleteAll_Call { | |||
| 124 | + | return &MockHistoryRepository_DeleteAll_Call{Call: _e.mock.On("DeleteAll", ctx)} | |||
| 125 | + | } | |||
| 126 | + | ||||
| 127 | + | func (_c *MockHistoryRepository_DeleteAll_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_DeleteAll_Call { | |||
| 128 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 129 | + | var arg0 context.Context | |||
| 130 | + | if args[0] != nil { | |||
| 131 | + | arg0 = args[0].(context.Context) | |||
| 132 | + | } | |||
| 133 | + | run( | |||
| 134 | + | arg0, | |||
| 135 | + | ) | |||
| 136 | + | }) | |||
| 137 | + | return _c | |||
| 138 | + | } | |||
| 139 | + | ||||
| 140 | + | func (_c *MockHistoryRepository_DeleteAll_Call) Return(err error) *MockHistoryRepository_DeleteAll_Call { | |||
| 141 | + | _c.Call.Return(err) | |||
| 142 | + | return _c | |||
| 143 | + | } | |||
| 144 | + | ||||
| 145 | + | func (_c *MockHistoryRepository_DeleteAll_Call) RunAndReturn(run func(ctx context.Context) error) *MockHistoryRepository_DeleteAll_Call { | |||
| 146 | + | _c.Call.Return(run) | |||
| 147 | + | return _c | |||
| 148 | + | } | |||
| 149 | + | ||||
| 150 | + | // DeleteByDomain provides a mock function for the type MockHistoryRepository | |||
| 151 | + | func (_mock *MockHistoryRepository) DeleteByDomain(ctx context.Context, domain string) error { | |||
| 152 | + | ret := _mock.Called(ctx, domain) | |||
| 153 | + | ||||
| 154 | + | if len(ret) == 0 { | |||
| 155 | + | panic("no return value specified for DeleteByDomain") | |||
| 156 | + | } | |||
| 157 | + | ||||
| 158 | + | var r0 error | |||
| 159 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { | |||
| 160 | + | r0 = returnFunc(ctx, domain) | |||
| 161 | + | } else { | |||
| 162 | + | r0 = ret.Error(0) | |||
| 163 | + | } | |||
| 164 | + | return r0 | |||
| 165 | + | } | |||
| 166 | + | ||||
| 167 | + | // MockHistoryRepository_DeleteByDomain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteByDomain' | |||
| 168 | + | type MockHistoryRepository_DeleteByDomain_Call struct { | |||
| 169 | + | *mock.Call | |||
| 170 | + | } | |||
| 171 | + | ||||
| 172 | + | // DeleteByDomain is a helper method to define mock.On call | |||
| 173 | + | // - ctx context.Context | |||
| 174 | + | // - domain string | |||
| 175 | + | func (_e *MockHistoryRepository_Expecter) DeleteByDomain(ctx interface{}, domain interface{}) *MockHistoryRepository_DeleteByDomain_Call { | |||
| 176 | + | return &MockHistoryRepository_DeleteByDomain_Call{Call: _e.mock.On("DeleteByDomain", ctx, domain)} | |||
| 177 | + | } | |||
| 178 | + | ||||
| 179 | + | func (_c *MockHistoryRepository_DeleteByDomain_Call) Run(run func(ctx context.Context, domain string)) *MockHistoryRepository_DeleteByDomain_Call { | |||
| 180 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 181 | + | var arg0 context.Context | |||
| 182 | + | if args[0] != nil { | |||
| 183 | + | arg0 = args[0].(context.Context) | |||
| 184 | + | } | |||
| 185 | + | var arg1 string | |||
| 186 | + | if args[1] != nil { | |||
| 187 | + | arg1 = args[1].(string) | |||
| 188 | + | } | |||
| 189 | + | run( | |||
| 190 | + | arg0, | |||
| 191 | + | arg1, | |||
| 192 | + | ) | |||
| 193 | + | }) | |||
| 194 | + | return _c | |||
| 195 | + | } | |||
| 196 | + | ||||
| 197 | + | func (_c *MockHistoryRepository_DeleteByDomain_Call) Return(err error) *MockHistoryRepository_DeleteByDomain_Call { | |||
| 198 | + | _c.Call.Return(err) | |||
| 199 | + | return _c | |||
| 200 | + | } | |||
| 201 | + | ||||
| 202 | + | func (_c *MockHistoryRepository_DeleteByDomain_Call) RunAndReturn(run func(ctx context.Context, domain string) error) *MockHistoryRepository_DeleteByDomain_Call { | |||
| 203 | + | _c.Call.Return(run) | |||
| 204 | + | return _c | |||
| 205 | + | } | |||
| 206 | + | ||||
| 207 | + | // DeleteOlderThan provides a mock function for the type MockHistoryRepository | |||
| 208 | + | func (_mock *MockHistoryRepository) DeleteOlderThan(ctx context.Context, before time.Time) error { | |||
| 209 | + | ret := _mock.Called(ctx, before) | |||
| 210 | + | ||||
| 211 | + | if len(ret) == 0 { | |||
| 212 | + | panic("no return value specified for DeleteOlderThan") | |||
| 213 | + | } | |||
| 214 | + | ||||
| 215 | + | var r0 error | |||
| 216 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time) error); ok { | |||
| 217 | + | r0 = returnFunc(ctx, before) | |||
| 218 | + | } else { | |||
| 219 | + | r0 = ret.Error(0) | |||
| 220 | + | } | |||
| 221 | + | return r0 | |||
| 222 | + | } | |||
| 223 | + | ||||
| 224 | + | // MockHistoryRepository_DeleteOlderThan_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteOlderThan' | |||
| 225 | + | type MockHistoryRepository_DeleteOlderThan_Call struct { | |||
| 226 | + | *mock.Call | |||
| 227 | + | } | |||
| 228 | + | ||||
| 229 | + | // DeleteOlderThan is a helper method to define mock.On call | |||
| 230 | + | // - ctx context.Context | |||
| 231 | + | // - before time.Time | |||
| 232 | + | func (_e *MockHistoryRepository_Expecter) DeleteOlderThan(ctx interface{}, before interface{}) *MockHistoryRepository_DeleteOlderThan_Call { | |||
| 233 | + | return &MockHistoryRepository_DeleteOlderThan_Call{Call: _e.mock.On("DeleteOlderThan", ctx, before)} | |||
| 234 | + | } | |||
| 235 | + | ||||
| 236 | + | func (_c *MockHistoryRepository_DeleteOlderThan_Call) Run(run func(ctx context.Context, before time.Time)) *MockHistoryRepository_DeleteOlderThan_Call { | |||
| 237 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 238 | + | var arg0 context.Context | |||
| 239 | + | if args[0] != nil { | |||
| 240 | + | arg0 = args[0].(context.Context) | |||
| 241 | + | } | |||
| 242 | + | var arg1 time.Time | |||
| 243 | + | if args[1] != nil { | |||
| 244 | + | arg1 = args[1].(time.Time) | |||
| 245 | + | } | |||
| 246 | + | run( | |||
| 247 | + | arg0, | |||
| 248 | + | arg1, | |||
| 249 | + | ) | |||
| 250 | + | }) | |||
| 251 | + | return _c | |||
| 252 | + | } | |||
| 253 | + | ||||
| 254 | + | func (_c *MockHistoryRepository_DeleteOlderThan_Call) Return(err error) *MockHistoryRepository_DeleteOlderThan_Call { | |||
| 255 | + | _c.Call.Return(err) | |||
| 256 | + | return _c | |||
| 257 | + | } | |||
| 258 | + | ||||
| 259 | + | func (_c *MockHistoryRepository_DeleteOlderThan_Call) RunAndReturn(run func(ctx context.Context, before time.Time) error) *MockHistoryRepository_DeleteOlderThan_Call { | |||
| 260 | + | _c.Call.Return(run) | |||
| 261 | + | return _c | |||
| 262 | + | } | |||
| 263 | + | ||||
| 264 | + | // FindByURL provides a mock function for the type MockHistoryRepository | |||
| 265 | + | func (_mock *MockHistoryRepository) FindByURL(ctx context.Context, url string) (*entity.HistoryEntry, error) { | |||
| 266 | + | ret := _mock.Called(ctx, url) | |||
| 267 | + | ||||
| 268 | + | if len(ret) == 0 { | |||
| 269 | + | panic("no return value specified for FindByURL") | |||
| 270 | + | } | |||
| 271 | + | ||||
| 272 | + | var r0 *entity.HistoryEntry | |||
| 273 | + | var r1 error | |||
| 274 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*entity.HistoryEntry, error)); ok { | |||
| 275 | + | return returnFunc(ctx, url) | |||
| 276 | + | } | |||
| 277 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) *entity.HistoryEntry); ok { | |||
| 278 | + | r0 = returnFunc(ctx, url) | |||
| 279 | + | } else { | |||
| 280 | + | if ret.Get(0) != nil { | |||
| 281 | + | r0 = ret.Get(0).(*entity.HistoryEntry) | |||
| 282 | + | } | |||
| 283 | + | } | |||
| 284 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { | |||
| 285 | + | r1 = returnFunc(ctx, url) | |||
| 286 | + | } else { | |||
| 287 | + | r1 = ret.Error(1) | |||
| 288 | + | } | |||
| 289 | + | return r0, r1 | |||
| 290 | + | } | |||
| 291 | + | ||||
| 292 | + | // MockHistoryRepository_FindByURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByURL' | |||
| 293 | + | type MockHistoryRepository_FindByURL_Call struct { | |||
| 294 | + | *mock.Call | |||
| 295 | + | } | |||
| 296 | + | ||||
| 297 | + | // FindByURL is a helper method to define mock.On call | |||
| 298 | + | // - ctx context.Context | |||
| 299 | + | // - url string | |||
| 300 | + | func (_e *MockHistoryRepository_Expecter) FindByURL(ctx interface{}, url interface{}) *MockHistoryRepository_FindByURL_Call { | |||
| 301 | + | return &MockHistoryRepository_FindByURL_Call{Call: _e.mock.On("FindByURL", ctx, url)} | |||
| 302 | + | } | |||
| 303 | + | ||||
| 304 | + | func (_c *MockHistoryRepository_FindByURL_Call) Run(run func(ctx context.Context, url string)) *MockHistoryRepository_FindByURL_Call { | |||
| 305 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 306 | + | var arg0 context.Context | |||
| 307 | + | if args[0] != nil { | |||
| 308 | + | arg0 = args[0].(context.Context) | |||
| 309 | + | } | |||
| 310 | + | var arg1 string | |||
| 311 | + | if args[1] != nil { | |||
| 312 | + | arg1 = args[1].(string) | |||
| 313 | + | } | |||
| 314 | + | run( | |||
| 315 | + | arg0, | |||
| 316 | + | arg1, | |||
| 317 | + | ) | |||
| 318 | + | }) | |||
| 319 | + | return _c | |||
| 320 | + | } | |||
| 321 | + | ||||
| 322 | + | func (_c *MockHistoryRepository_FindByURL_Call) Return(historyEntry *entity.HistoryEntry, err error) *MockHistoryRepository_FindByURL_Call { | |||
| 323 | + | _c.Call.Return(historyEntry, err) | |||
| 324 | + | return _c | |||
| 325 | + | } | |||
| 326 | + | ||||
| 327 | + | func (_c *MockHistoryRepository_FindByURL_Call) RunAndReturn(run func(ctx context.Context, url string) (*entity.HistoryEntry, error)) *MockHistoryRepository_FindByURL_Call { | |||
| 328 | + | _c.Call.Return(run) | |||
| 329 | + | return _c | |||
| 330 | + | } | |||
| 331 | + | ||||
| 332 | + | // GetDailyVisitCount provides a mock function for the type MockHistoryRepository | |||
| 333 | + | func (_mock *MockHistoryRepository) GetDailyVisitCount(ctx context.Context, daysAgo string) ([]*entity.DailyVisitCount, error) { | |||
| 334 | + | ret := _mock.Called(ctx, daysAgo) | |||
| 335 | + | ||||
| 336 | + | if len(ret) == 0 { | |||
| 337 | + | panic("no return value specified for GetDailyVisitCount") | |||
| 338 | + | } | |||
| 339 | + | ||||
| 340 | + | var r0 []*entity.DailyVisitCount | |||
| 341 | + | var r1 error | |||
| 342 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]*entity.DailyVisitCount, error)); ok { | |||
| 343 | + | return returnFunc(ctx, daysAgo) | |||
| 344 | + | } | |||
| 345 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) []*entity.DailyVisitCount); ok { | |||
| 346 | + | r0 = returnFunc(ctx, daysAgo) | |||
| 347 | + | } else { | |||
| 348 | + | if ret.Get(0) != nil { | |||
| 349 | + | r0 = ret.Get(0).([]*entity.DailyVisitCount) | |||
| 350 | + | } | |||
| 351 | + | } | |||
| 352 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { | |||
| 353 | + | r1 = returnFunc(ctx, daysAgo) | |||
| 354 | + | } else { | |||
| 355 | + | r1 = ret.Error(1) | |||
| 356 | + | } | |||
| 357 | + | return r0, r1 | |||
| 358 | + | } | |||
| 359 | + | ||||
| 360 | + | // MockHistoryRepository_GetDailyVisitCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDailyVisitCount' | |||
| 361 | + | type MockHistoryRepository_GetDailyVisitCount_Call struct { | |||
| 362 | + | *mock.Call | |||
| 363 | + | } | |||
| 364 | + | ||||
| 365 | + | // GetDailyVisitCount is a helper method to define mock.On call | |||
| 366 | + | // - ctx context.Context | |||
| 367 | + | // - daysAgo string | |||
| 368 | + | func (_e *MockHistoryRepository_Expecter) GetDailyVisitCount(ctx interface{}, daysAgo interface{}) *MockHistoryRepository_GetDailyVisitCount_Call { | |||
| 369 | + | return &MockHistoryRepository_GetDailyVisitCount_Call{Call: _e.mock.On("GetDailyVisitCount", ctx, daysAgo)} | |||
| 370 | + | } | |||
| 371 | + | ||||
| 372 | + | func (_c *MockHistoryRepository_GetDailyVisitCount_Call) Run(run func(ctx context.Context, daysAgo string)) *MockHistoryRepository_GetDailyVisitCount_Call { | |||
| 373 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 374 | + | var arg0 context.Context | |||
| 375 | + | if args[0] != nil { | |||
| 376 | + | arg0 = args[0].(context.Context) | |||
| 377 | + | } | |||
| 378 | + | var arg1 string | |||
| 379 | + | if args[1] != nil { | |||
| 380 | + | arg1 = args[1].(string) | |||
| 381 | + | } | |||
| 382 | + | run( | |||
| 383 | + | arg0, | |||
| 384 | + | arg1, | |||
| 385 | + | ) | |||
| 386 | + | }) | |||
| 387 | + | return _c | |||
| 388 | + | } | |||
| 389 | + | ||||
| 390 | + | func (_c *MockHistoryRepository_GetDailyVisitCount_Call) Return(dailyVisitCounts []*entity.DailyVisitCount, err error) *MockHistoryRepository_GetDailyVisitCount_Call { | |||
| 391 | + | _c.Call.Return(dailyVisitCounts, err) | |||
| 392 | + | return _c | |||
| 393 | + | } | |||
| 394 | + | ||||
| 395 | + | func (_c *MockHistoryRepository_GetDailyVisitCount_Call) RunAndReturn(run func(ctx context.Context, daysAgo string) ([]*entity.DailyVisitCount, error)) *MockHistoryRepository_GetDailyVisitCount_Call { | |||
| 396 | + | _c.Call.Return(run) | |||
| 397 | + | return _c | |||
| 398 | + | } | |||
| 399 | + | ||||
| 400 | + | // GetDomainStats provides a mock function for the type MockHistoryRepository | |||
| 401 | + | func (_mock *MockHistoryRepository) GetDomainStats(ctx context.Context, limit int) ([]*entity.DomainStat, error) { | |||
| 402 | + | ret := _mock.Called(ctx, limit) | |||
| 403 | + | ||||
| 404 | + | if len(ret) == 0 { | |||
| 405 | + | panic("no return value specified for GetDomainStats") | |||
| 406 | + | } | |||
| 407 | + | ||||
| 408 | + | var r0 []*entity.DomainStat | |||
| 409 | + | var r1 error | |||
| 410 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, int) ([]*entity.DomainStat, error)); ok { | |||
| 411 | + | return returnFunc(ctx, limit) | |||
| 412 | + | } | |||
| 413 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, int) []*entity.DomainStat); ok { | |||
| 414 | + | r0 = returnFunc(ctx, limit) | |||
| 415 | + | } else { | |||
| 416 | + | if ret.Get(0) != nil { | |||
| 417 | + | r0 = ret.Get(0).([]*entity.DomainStat) | |||
| 418 | + | } | |||
| 419 | + | } | |||
| 420 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, int) error); ok { | |||
| 421 | + | r1 = returnFunc(ctx, limit) | |||
| 422 | + | } else { | |||
| 423 | + | r1 = ret.Error(1) | |||
| 424 | + | } | |||
| 425 | + | return r0, r1 | |||
| 426 | + | } | |||
| 427 | + | ||||
| 428 | + | // MockHistoryRepository_GetDomainStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDomainStats' | |||
| 429 | + | type MockHistoryRepository_GetDomainStats_Call struct { | |||
| 430 | + | *mock.Call | |||
| 431 | + | } | |||
| 432 | + | ||||
| 433 | + | // GetDomainStats is a helper method to define mock.On call | |||
| 434 | + | // - ctx context.Context | |||
| 435 | + | // - limit int | |||
| 436 | + | func (_e *MockHistoryRepository_Expecter) GetDomainStats(ctx interface{}, limit interface{}) *MockHistoryRepository_GetDomainStats_Call { | |||
| 437 | + | return &MockHistoryRepository_GetDomainStats_Call{Call: _e.mock.On("GetDomainStats", ctx, limit)} | |||
| 438 | + | } | |||
| 439 | + | ||||
| 440 | + | func (_c *MockHistoryRepository_GetDomainStats_Call) Run(run func(ctx context.Context, limit int)) *MockHistoryRepository_GetDomainStats_Call { | |||
| 441 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 442 | + | var arg0 context.Context | |||
| 443 | + | if args[0] != nil { | |||
| 444 | + | arg0 = args[0].(context.Context) | |||
| 445 | + | } | |||
| 446 | + | var arg1 int | |||
| 447 | + | if args[1] != nil { | |||
| 448 | + | arg1 = args[1].(int) | |||
| 449 | + | } | |||
| 450 | + | run( | |||
| 451 | + | arg0, | |||
| 452 | + | arg1, | |||
| 453 | + | ) | |||
| 454 | + | }) | |||
| 455 | + | return _c | |||
| 456 | + | } | |||
| 457 | + | ||||
| 458 | + | func (_c *MockHistoryRepository_GetDomainStats_Call) Return(domainStats []*entity.DomainStat, err error) *MockHistoryRepository_GetDomainStats_Call { | |||
| 459 | + | _c.Call.Return(domainStats, err) | |||
| 460 | + | return _c | |||
| 461 | + | } | |||
| 462 | + | ||||
| 463 | + | func (_c *MockHistoryRepository_GetDomainStats_Call) RunAndReturn(run func(ctx context.Context, limit int) ([]*entity.DomainStat, error)) *MockHistoryRepository_GetDomainStats_Call { | |||
| 464 | + | _c.Call.Return(run) | |||
| 465 | + | return _c | |||
| 466 | + | } | |||
| 467 | + | ||||
| 468 | + | // GetHourlyDistribution provides a mock function for the type MockHistoryRepository | |||
| 469 | + | func (_mock *MockHistoryRepository) GetHourlyDistribution(ctx context.Context) ([]*entity.HourlyDistribution, error) { | |||
| 470 | + | ret := _mock.Called(ctx) | |||
| 471 | + | ||||
| 472 | + | if len(ret) == 0 { | |||
| 473 | + | panic("no return value specified for GetHourlyDistribution") | |||
| 474 | + | } | |||
| 475 | + | ||||
| 476 | + | var r0 []*entity.HourlyDistribution | |||
| 477 | + | var r1 error | |||
| 478 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.HourlyDistribution, error)); ok { | |||
| 479 | + | return returnFunc(ctx) | |||
| 480 | + | } | |||
| 481 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.HourlyDistribution); ok { | |||
| 482 | + | r0 = returnFunc(ctx) | |||
| 483 | + | } else { | |||
| 484 | + | if ret.Get(0) != nil { | |||
| 485 | + | r0 = ret.Get(0).([]*entity.HourlyDistribution) | |||
| 486 | + | } | |||
| 487 | + | } | |||
| 488 | + | if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { | |||
| 489 | + | r1 = returnFunc(ctx) | |||
| 490 | + | } else { | |||
| 491 | + | r1 = ret.Error(1) | |||
| 492 | + | } | |||
| 493 | + | return r0, r1 | |||
| 494 | + | } | |||
| 495 | + | ||||
| 496 | + | // MockHistoryRepository_GetHourlyDistribution_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHourlyDistribution' | |||
| 497 | + | type MockHistoryRepository_GetHourlyDistribution_Call struct { | |||
| 498 | + | *mock.Call | |||
| 499 | + | } | |||
| 500 | + | ||||
| 501 | + | // GetHourlyDistribution is a helper method to define mock.On call | |||
| 502 | + | // - ctx context.Context | |||
| 503 | + | func (_e *MockHistoryRepository_Expecter) GetHourlyDistribution(ctx interface{}) *MockHistoryRepository_GetHourlyDistribution_Call { | |||
| 504 | + | return &MockHistoryRepository_GetHourlyDistribution_Call{Call: _e.mock.On("GetHourlyDistribution", ctx)} | |||
| 505 | + | } | |||
| 506 | + | ||||
| 507 | + | func (_c *MockHistoryRepository_GetHourlyDistribution_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_GetHourlyDistribution_Call { | |||
| 508 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 509 | + | var arg0 context.Context | |||
| 510 | + | if args[0] != nil { | |||
| 511 | + | arg0 = args[0].(context.Context) | |||
| 512 | + | } | |||
| 513 | + | run( | |||
| 514 | + | arg0, | |||
| 515 | + | ) | |||
| 516 | + | }) | |||
| 517 | + | return _c | |||
| 518 | + | } | |||
| 519 | + | ||||
| 520 | + | func (_c *MockHistoryRepository_GetHourlyDistribution_Call) Return(hourlyDistributions []*entity.HourlyDistribution, err error) *MockHistoryRepository_GetHourlyDistribution_Call { | |||
| 521 | + | _c.Call.Return(hourlyDistributions, err) | |||
| 522 | + | return _c | |||
| 523 | + | } | |||
| 524 | + | ||||
| 525 | + | func (_c *MockHistoryRepository_GetHourlyDistribution_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.HourlyDistribution, error)) *MockHistoryRepository_GetHourlyDistribution_Call { | |||
| 526 | + | _c.Call.Return(run) | |||
| 527 | + | return _c | |||
| 528 | + | } | |||
| 529 | + | ||||
| 530 | + | // GetRecent provides a mock function for the type MockHistoryRepository | |||
| 531 | + | func (_mock *MockHistoryRepository) GetRecent(ctx context.Context, limit int, offset int) ([]*entity.HistoryEntry, error) { | |||
| 532 | + | ret := _mock.Called(ctx, limit, offset) | |||
| 533 | + | ||||
| 534 | + | if len(ret) == 0 { | |||
| 535 | + | panic("no return value specified for GetRecent") | |||
| 536 | + | } | |||
| 537 | + | ||||
| 538 | + | var r0 []*entity.HistoryEntry | |||
| 539 | + | var r1 error | |||
| 540 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, int, int) ([]*entity.HistoryEntry, error)); ok { | |||
| 541 | + | return returnFunc(ctx, limit, offset) | |||
| 542 | + | } | |||
| 543 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, int, int) []*entity.HistoryEntry); ok { | |||
| 544 | + | r0 = returnFunc(ctx, limit, offset) | |||
| 545 | + | } else { | |||
| 546 | + | if ret.Get(0) != nil { | |||
| 547 | + | r0 = ret.Get(0).([]*entity.HistoryEntry) | |||
| 548 | + | } | |||
| 549 | + | } | |||
| 550 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, int, int) error); ok { | |||
| 551 | + | r1 = returnFunc(ctx, limit, offset) | |||
| 552 | + | } else { | |||
| 553 | + | r1 = ret.Error(1) | |||
| 554 | + | } | |||
| 555 | + | return r0, r1 | |||
| 556 | + | } | |||
| 557 | + | ||||
| 558 | + | // MockHistoryRepository_GetRecent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRecent' | |||
| 559 | + | type MockHistoryRepository_GetRecent_Call struct { | |||
| 560 | + | *mock.Call | |||
| 561 | + | } | |||
| 562 | + | ||||
| 563 | + | // GetRecent is a helper method to define mock.On call | |||
| 564 | + | // - ctx context.Context | |||
| 565 | + | // - limit int | |||
| 566 | + | // - offset int | |||
| 567 | + | func (_e *MockHistoryRepository_Expecter) GetRecent(ctx interface{}, limit interface{}, offset interface{}) *MockHistoryRepository_GetRecent_Call { | |||
| 568 | + | return &MockHistoryRepository_GetRecent_Call{Call: _e.mock.On("GetRecent", ctx, limit, offset)} | |||
| 569 | + | } | |||
| 570 | + | ||||
| 571 | + | func (_c *MockHistoryRepository_GetRecent_Call) Run(run func(ctx context.Context, limit int, offset int)) *MockHistoryRepository_GetRecent_Call { | |||
| 572 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 573 | + | var arg0 context.Context | |||
| 574 | + | if args[0] != nil { | |||
| 575 | + | arg0 = args[0].(context.Context) | |||
| 576 | + | } | |||
| 577 | + | var arg1 int | |||
| 578 | + | if args[1] != nil { | |||
| 579 | + | arg1 = args[1].(int) | |||
| 580 | + | } | |||
| 581 | + | var arg2 int | |||
| 582 | + | if args[2] != nil { | |||
| 583 | + | arg2 = args[2].(int) | |||
| 584 | + | } | |||
| 585 | + | run( | |||
| 586 | + | arg0, | |||
| 587 | + | arg1, | |||
| 588 | + | arg2, | |||
| 589 | + | ) | |||
| 590 | + | }) | |||
| 591 | + | return _c | |||
| 592 | + | } | |||
| 593 | + | ||||
| 594 | + | func (_c *MockHistoryRepository_GetRecent_Call) Return(historyEntrys []*entity.HistoryEntry, err error) *MockHistoryRepository_GetRecent_Call { | |||
| 595 | + | _c.Call.Return(historyEntrys, err) | |||
| 596 | + | return _c | |||
| 597 | + | } | |||
| 598 | + | ||||
| 599 | + | func (_c *MockHistoryRepository_GetRecent_Call) RunAndReturn(run func(ctx context.Context, limit int, offset int) ([]*entity.HistoryEntry, error)) *MockHistoryRepository_GetRecent_Call { | |||
| 600 | + | _c.Call.Return(run) | |||
| 601 | + | return _c | |||
| 602 | + | } | |||
| 603 | + | ||||
| 604 | + | // GetStats provides a mock function for the type MockHistoryRepository | |||
| 605 | + | func (_mock *MockHistoryRepository) GetStats(ctx context.Context) (*entity.HistoryStats, error) { | |||
| 606 | + | ret := _mock.Called(ctx) | |||
| 607 | + | ||||
| 608 | + | if len(ret) == 0 { | |||
| 609 | + | panic("no return value specified for GetStats") | |||
| 610 | + | } | |||
| 611 | + | ||||
| 612 | + | var r0 *entity.HistoryStats | |||
| 613 | + | var r1 error | |||
| 614 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) (*entity.HistoryStats, error)); ok { | |||
| 615 | + | return returnFunc(ctx) | |||
| 616 | + | } | |||
| 617 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) *entity.HistoryStats); ok { | |||
| 618 | + | r0 = returnFunc(ctx) | |||
| 619 | + | } else { | |||
| 620 | + | if ret.Get(0) != nil { | |||
| 621 | + | r0 = ret.Get(0).(*entity.HistoryStats) | |||
| 622 | + | } | |||
| 623 | + | } | |||
| 624 | + | if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { | |||
| 625 | + | r1 = returnFunc(ctx) | |||
| 626 | + | } else { | |||
| 627 | + | r1 = ret.Error(1) | |||
| 628 | + | } | |||
| 629 | + | return r0, r1 | |||
| 630 | + | } | |||
| 631 | + | ||||
| 632 | + | // MockHistoryRepository_GetStats_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStats' | |||
| 633 | + | type MockHistoryRepository_GetStats_Call struct { | |||
| 634 | + | *mock.Call | |||
| 635 | + | } | |||
| 636 | + | ||||
| 637 | + | // GetStats is a helper method to define mock.On call | |||
| 638 | + | // - ctx context.Context | |||
| 639 | + | func (_e *MockHistoryRepository_Expecter) GetStats(ctx interface{}) *MockHistoryRepository_GetStats_Call { | |||
| 640 | + | return &MockHistoryRepository_GetStats_Call{Call: _e.mock.On("GetStats", ctx)} | |||
| 641 | + | } | |||
| 642 | + | ||||
| 643 | + | func (_c *MockHistoryRepository_GetStats_Call) Run(run func(ctx context.Context)) *MockHistoryRepository_GetStats_Call { | |||
| 644 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 645 | + | var arg0 context.Context | |||
| 646 | + | if args[0] != nil { | |||
| 647 | + | arg0 = args[0].(context.Context) | |||
| 648 | + | } | |||
| 649 | + | run( | |||
| 650 | + | arg0, | |||
| 651 | + | ) | |||
| 652 | + | }) | |||
| 653 | + | return _c | |||
| 654 | + | } | |||
| 655 | + | ||||
| 656 | + | func (_c *MockHistoryRepository_GetStats_Call) Return(historyStats *entity.HistoryStats, err error) *MockHistoryRepository_GetStats_Call { | |||
| 657 | + | _c.Call.Return(historyStats, err) | |||
| 658 | + | return _c | |||
| 659 | + | } | |||
| 660 | + | ||||
| 661 | + | func (_c *MockHistoryRepository_GetStats_Call) RunAndReturn(run func(ctx context.Context) (*entity.HistoryStats, error)) *MockHistoryRepository_GetStats_Call { | |||
| 662 | + | _c.Call.Return(run) | |||
| 663 | + | return _c | |||
| 664 | + | } | |||
| 665 | + | ||||
| 666 | + | // IncrementVisitCount provides a mock function for the type MockHistoryRepository | |||
| 667 | + | func (_mock *MockHistoryRepository) IncrementVisitCount(ctx context.Context, url string) error { | |||
| 668 | + | ret := _mock.Called(ctx, url) | |||
| 669 | + | ||||
| 670 | + | if len(ret) == 0 { | |||
| 671 | + | panic("no return value specified for IncrementVisitCount") | |||
| 672 | + | } | |||
| 673 | + | ||||
| 674 | + | var r0 error | |||
| 675 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { | |||
| 676 | + | r0 = returnFunc(ctx, url) | |||
| 677 | + | } else { | |||
| 678 | + | r0 = ret.Error(0) | |||
| 679 | + | } | |||
| 680 | + | return r0 | |||
| 681 | + | } | |||
| 682 | + | ||||
| 683 | + | // MockHistoryRepository_IncrementVisitCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncrementVisitCount' | |||
| 684 | + | type MockHistoryRepository_IncrementVisitCount_Call struct { | |||
| 685 | + | *mock.Call | |||
| 686 | + | } | |||
| 687 | + | ||||
| 688 | + | // IncrementVisitCount is a helper method to define mock.On call | |||
| 689 | + | // - ctx context.Context | |||
| 690 | + | // - url string | |||
| 691 | + | func (_e *MockHistoryRepository_Expecter) IncrementVisitCount(ctx interface{}, url interface{}) *MockHistoryRepository_IncrementVisitCount_Call { | |||
| 692 | + | return &MockHistoryRepository_IncrementVisitCount_Call{Call: _e.mock.On("IncrementVisitCount", ctx, url)} | |||
| 693 | + | } | |||
| 694 | + | ||||
| 695 | + | func (_c *MockHistoryRepository_IncrementVisitCount_Call) Run(run func(ctx context.Context, url string)) *MockHistoryRepository_IncrementVisitCount_Call { | |||
| 696 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 697 | + | var arg0 context.Context | |||
| 698 | + | if args[0] != nil { | |||
| 699 | + | arg0 = args[0].(context.Context) | |||
| 700 | + | } | |||
| 701 | + | var arg1 string | |||
| 702 | + | if args[1] != nil { | |||
| 703 | + | arg1 = args[1].(string) | |||
| 704 | + | } | |||
| 705 | + | run( | |||
| 706 | + | arg0, | |||
| 707 | + | arg1, | |||
| 708 | + | ) | |||
| 709 | + | }) | |||
| 710 | + | return _c | |||
| 711 | + | } | |||
| 712 | + | ||||
| 713 | + | func (_c *MockHistoryRepository_IncrementVisitCount_Call) Return(err error) *MockHistoryRepository_IncrementVisitCount_Call { | |||
| 714 | + | _c.Call.Return(err) | |||
| 715 | + | return _c | |||
| 716 | + | } | |||
| 717 | + | ||||
| 718 | + | func (_c *MockHistoryRepository_IncrementVisitCount_Call) RunAndReturn(run func(ctx context.Context, url string) error) *MockHistoryRepository_IncrementVisitCount_Call { | |||
| 719 | + | _c.Call.Return(run) | |||
| 720 | + | return _c | |||
| 721 | + | } | |||
| 722 | + | ||||
| 723 | + | // Save provides a mock function for the type MockHistoryRepository | |||
| 724 | + | func (_mock *MockHistoryRepository) Save(ctx context.Context, entry *entity.HistoryEntry) error { | |||
| 725 | + | ret := _mock.Called(ctx, entry) | |||
| 726 | + | ||||
| 727 | + | if len(ret) == 0 { | |||
| 728 | + | panic("no return value specified for Save") | |||
| 729 | + | } | |||
| 730 | + | ||||
| 731 | + | var r0 error | |||
| 732 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.HistoryEntry) error); ok { | |||
| 733 | + | r0 = returnFunc(ctx, entry) | |||
| 734 | + | } else { | |||
| 735 | + | r0 = ret.Error(0) | |||
| 736 | + | } | |||
| 737 | + | return r0 | |||
| 738 | + | } | |||
| 739 | + | ||||
| 740 | + | // MockHistoryRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' | |||
| 741 | + | type MockHistoryRepository_Save_Call struct { | |||
| 742 | + | *mock.Call | |||
| 743 | + | } | |||
| 744 | + | ||||
| 745 | + | // Save is a helper method to define mock.On call | |||
| 746 | + | // - ctx context.Context | |||
| 747 | + | // - entry *entity.HistoryEntry | |||
| 748 | + | func (_e *MockHistoryRepository_Expecter) Save(ctx interface{}, entry interface{}) *MockHistoryRepository_Save_Call { | |||
| 749 | + | return &MockHistoryRepository_Save_Call{Call: _e.mock.On("Save", ctx, entry)} | |||
| 750 | + | } | |||
| 751 | + | ||||
| 752 | + | func (_c *MockHistoryRepository_Save_Call) Run(run func(ctx context.Context, entry *entity.HistoryEntry)) *MockHistoryRepository_Save_Call { | |||
| 753 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 754 | + | var arg0 context.Context | |||
| 755 | + | if args[0] != nil { | |||
| 756 | + | arg0 = args[0].(context.Context) | |||
| 757 | + | } | |||
| 758 | + | var arg1 *entity.HistoryEntry | |||
| 759 | + | if args[1] != nil { | |||
| 760 | + | arg1 = args[1].(*entity.HistoryEntry) | |||
| 761 | + | } | |||
| 762 | + | run( | |||
| 763 | + | arg0, | |||
| 764 | + | arg1, | |||
| 765 | + | ) | |||
| 766 | + | }) | |||
| 767 | + | return _c | |||
| 768 | + | } | |||
| 769 | + | ||||
| 770 | + | func (_c *MockHistoryRepository_Save_Call) Return(err error) *MockHistoryRepository_Save_Call { | |||
| 771 | + | _c.Call.Return(err) | |||
| 772 | + | return _c | |||
| 773 | + | } | |||
| 774 | + | ||||
| 775 | + | func (_c *MockHistoryRepository_Save_Call) RunAndReturn(run func(ctx context.Context, entry *entity.HistoryEntry) error) *MockHistoryRepository_Save_Call { | |||
| 776 | + | _c.Call.Return(run) | |||
| 777 | + | return _c | |||
| 778 | + | } | |||
| 779 | + | ||||
| 780 | + | // Search provides a mock function for the type MockHistoryRepository | |||
| 781 | + | func (_mock *MockHistoryRepository) Search(ctx context.Context, query string, limit int) ([]entity.HistoryMatch, error) { | |||
| 782 | + | ret := _mock.Called(ctx, query, limit) | |||
| 783 | + | ||||
| 784 | + | if len(ret) == 0 { | |||
| 785 | + | panic("no return value specified for Search") | |||
| 786 | + | } | |||
| 787 | + | ||||
| 788 | + | var r0 []entity.HistoryMatch | |||
| 789 | + | var r1 error | |||
| 790 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string, int) ([]entity.HistoryMatch, error)); ok { | |||
| 791 | + | return returnFunc(ctx, query, limit) | |||
| 792 | + | } | |||
| 793 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string, int) []entity.HistoryMatch); ok { | |||
| 794 | + | r0 = returnFunc(ctx, query, limit) | |||
| 795 | + | } else { | |||
| 796 | + | if ret.Get(0) != nil { | |||
| 797 | + | r0 = ret.Get(0).([]entity.HistoryMatch) | |||
| 798 | + | } | |||
| 799 | + | } | |||
| 800 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, string, int) error); ok { | |||
| 801 | + | r1 = returnFunc(ctx, query, limit) | |||
| 802 | + | } else { | |||
| 803 | + | r1 = ret.Error(1) | |||
| 804 | + | } | |||
| 805 | + | return r0, r1 | |||
| 806 | + | } | |||
| 807 | + | ||||
| 808 | + | // MockHistoryRepository_Search_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Search' | |||
| 809 | + | type MockHistoryRepository_Search_Call struct { | |||
| 810 | + | *mock.Call | |||
| 811 | + | } | |||
| 812 | + | ||||
| 813 | + | // Search is a helper method to define mock.On call | |||
| 814 | + | // - ctx context.Context | |||
| 815 | + | // - query string | |||
| 816 | + | // - limit int | |||
| 817 | + | func (_e *MockHistoryRepository_Expecter) Search(ctx interface{}, query interface{}, limit interface{}) *MockHistoryRepository_Search_Call { | |||
| 818 | + | return &MockHistoryRepository_Search_Call{Call: _e.mock.On("Search", ctx, query, limit)} | |||
| 819 | + | } | |||
| 820 | + | ||||
| 821 | + | func (_c *MockHistoryRepository_Search_Call) Run(run func(ctx context.Context, query string, limit int)) *MockHistoryRepository_Search_Call { | |||
| 822 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 823 | + | var arg0 context.Context | |||
| 824 | + | if args[0] != nil { | |||
| 825 | + | arg0 = args[0].(context.Context) | |||
| 826 | + | } | |||
| 827 | + | var arg1 string | |||
| 828 | + | if args[1] != nil { | |||
| 829 | + | arg1 = args[1].(string) | |||
| 830 | + | } | |||
| 831 | + | var arg2 int | |||
| 832 | + | if args[2] != nil { | |||
| 833 | + | arg2 = args[2].(int) | |||
| 834 | + | } | |||
| 835 | + | run( | |||
| 836 | + | arg0, | |||
| 837 | + | arg1, | |||
| 838 | + | arg2, | |||
| 839 | + | ) | |||
| 840 | + | }) | |||
| 841 | + | return _c | |||
| 842 | + | } | |||
| 843 | + | ||||
| 844 | + | func (_c *MockHistoryRepository_Search_Call) Return(historyMatchs []entity.HistoryMatch, err error) *MockHistoryRepository_Search_Call { | |||
| 845 | + | _c.Call.Return(historyMatchs, err) | |||
| 846 | + | return _c | |||
| 847 | + | } | |||
| 848 | + | ||||
| 849 | + | func (_c *MockHistoryRepository_Search_Call) RunAndReturn(run func(ctx context.Context, query string, limit int) ([]entity.HistoryMatch, error)) *MockHistoryRepository_Search_Call { | |||
| 850 | + | _c.Call.Return(run) | |||
| 851 | + | return _c | |||
| 852 | + | } | |||
A internal/domain/repository/mocks/mock_tag_repository.go +545 -0
| @@ -0,0 +1,545 @@ | |||
| 1 | + | // Code generated by mockery; DO NOT EDIT. | |
| 2 | + | // github.com/vektra/mockery | |
| 3 | + | // template: testify | |
| 4 | + | ||
| 5 | + | package mocks | |
| 6 | + | ||
| 7 | + | import ( | |
| 8 | + | "context" | |
| 9 | + | ||
| 10 | + | "github.com/bnema/dumber/internal/domain/entity" | |
| 11 | + | mock "github.com/stretchr/testify/mock" | |
| 12 | + | ) | |
| 13 | + | ||
| 14 | + | // NewMockTagRepository creates a new instance of MockTagRepository. 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. | |
| 16 | + | func NewMockTagRepository(t interface { | |
| 17 | + | mock.TestingT | |
| 18 | + | Cleanup(func()) | |
| 19 | + | }) *MockTagRepository { | |
| 20 | + | mock := &MockTagRepository{} | |
| 21 | + | mock.Mock.Test(t) | |
| 22 | + | ||
| 23 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| 24 | + | ||
| 25 | + | return mock | |
| 26 | + | } | |
| 27 | + | ||
| 28 | + | // MockTagRepository is an autogenerated mock type for the TagRepository type | |
| 29 | + | type MockTagRepository struct { | |
| 30 | + | mock.Mock | |
| 31 | + | } | |
| 32 | + | ||
| 33 | + | type MockTagRepository_Expecter struct { | |
| 34 | + | mock *mock.Mock | |
| 35 | + | } | |
| 36 | + | ||
| 37 | + | func (_m *MockTagRepository) EXPECT() *MockTagRepository_Expecter { | |
| 38 | + | return &MockTagRepository_Expecter{mock: &_m.Mock} | |
| 39 | + | } | |
| 40 | + | ||
| 41 | + | // AssignToFavorite provides a mock function for the type MockTagRepository | |
| 42 | + | func (_mock *MockTagRepository) AssignToFavorite(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID) error { | |
| 43 | + | ret := _mock.Called(ctx, tagID, favID) | |
| 44 | + | ||
| 45 | + | if len(ret) == 0 { | |
| 46 | + | panic("no return value specified for AssignToFavorite") | |
| 47 | + | } | |
| 48 | + | ||
| 49 | + | var r0 error | |
| 50 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID, entity.FavoriteID) error); ok { | |
| 51 | + | r0 = returnFunc(ctx, tagID, favID) | |
| 52 | + | } else { | |
| 53 | + | r0 = ret.Error(0) | |
| 54 | + | } | |
| 55 | + | return r0 | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | // MockTagRepository_AssignToFavorite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AssignToFavorite' | |
| 59 | + | type MockTagRepository_AssignToFavorite_Call struct { | |
| 60 | + | *mock.Call | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // AssignToFavorite is a helper method to define mock.On call | |
| 64 | + | // - ctx context.Context | |
| 65 | + | // - tagID entity.TagID | |
| 66 | + | // - favID entity.FavoriteID | |
| 67 | + | func (_e *MockTagRepository_Expecter) AssignToFavorite(ctx interface{}, tagID interface{}, favID interface{}) *MockTagRepository_AssignToFavorite_Call { | |
| 68 | + | return &MockTagRepository_AssignToFavorite_Call{Call: _e.mock.On("AssignToFavorite", ctx, tagID, favID)} | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | func (_c *MockTagRepository_AssignToFavorite_Call) Run(run func(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID)) *MockTagRepository_AssignToFavorite_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 entity.TagID | |
| 78 | + | if args[1] != nil { | |
| 79 | + | arg1 = args[1].(entity.TagID) | |
| 80 | + | } | |
| 81 | + | var arg2 entity.FavoriteID | |
| 82 | + | if args[2] != nil { | |
| 83 | + | arg2 = args[2].(entity.FavoriteID) | |
| 84 | + | } | |
| 85 | + | run( | |
| 86 | + | arg0, | |
| 87 | + | arg1, | |
| 88 | + | arg2, | |
| 89 | + | ) | |
| 90 | + | }) | |
| 91 | + | return _c | |
| 92 | + | } | |
| 93 | + | ||
| 94 | + | func (_c *MockTagRepository_AssignToFavorite_Call) Return(err error) *MockTagRepository_AssignToFavorite_Call { | |
| 95 | + | _c.Call.Return(err) | |
| 96 | + | return _c | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | func (_c *MockTagRepository_AssignToFavorite_Call) RunAndReturn(run func(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID) error) *MockTagRepository_AssignToFavorite_Call { | |
| 100 | + | _c.Call.Return(run) | |
| 101 | + | return _c | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | // Delete provides a mock function for the type MockTagRepository | |
| 105 | + | func (_mock *MockTagRepository) Delete(ctx context.Context, id entity.TagID) error { | |
| 106 | + | ret := _mock.Called(ctx, id) | |
| 107 | + | ||
| 108 | + | if len(ret) == 0 { | |
| 109 | + | panic("no return value specified for Delete") | |
| 110 | + | } | |
| 111 | + | ||
| 112 | + | var r0 error | |
| 113 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID) error); ok { | |
| 114 | + | r0 = returnFunc(ctx, id) | |
| 115 | + | } else { | |
| 116 | + | r0 = ret.Error(0) | |
| 117 | + | } | |
| 118 | + | return r0 | |
| 119 | + | } | |
| 120 | + | ||
| 121 | + | // MockTagRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' | |
| 122 | + | type MockTagRepository_Delete_Call struct { | |
| 123 | + | *mock.Call | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | // Delete is a helper method to define mock.On call | |
| 127 | + | // - ctx context.Context | |
| 128 | + | // - id entity.TagID | |
| 129 | + | func (_e *MockTagRepository_Expecter) Delete(ctx interface{}, id interface{}) *MockTagRepository_Delete_Call { | |
| 130 | + | return &MockTagRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} | |
| 131 | + | } | |
| 132 | + | ||
| 133 | + | func (_c *MockTagRepository_Delete_Call) Run(run func(ctx context.Context, id entity.TagID)) *MockTagRepository_Delete_Call { | |
| 134 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 135 | + | var arg0 context.Context | |
| 136 | + | if args[0] != nil { | |
| 137 | + | arg0 = args[0].(context.Context) | |
| 138 | + | } | |
| 139 | + | var arg1 entity.TagID | |
| 140 | + | if args[1] != nil { | |
| 141 | + | arg1 = args[1].(entity.TagID) | |
| 142 | + | } | |
| 143 | + | run( | |
| 144 | + | arg0, | |
| 145 | + | arg1, | |
| 146 | + | ) | |
| 147 | + | }) | |
| 148 | + | return _c | |
| 149 | + | } | |
| 150 | + | ||
| 151 | + | func (_c *MockTagRepository_Delete_Call) Return(err error) *MockTagRepository_Delete_Call { | |
| 152 | + | _c.Call.Return(err) | |
| 153 | + | return _c | |
| 154 | + | } | |
| 155 | + | ||
| 156 | + | func (_c *MockTagRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, id entity.TagID) error) *MockTagRepository_Delete_Call { | |
| 157 | + | _c.Call.Return(run) | |
| 158 | + | return _c | |
| 159 | + | } | |
| 160 | + | ||
| 161 | + | // FindByID provides a mock function for the type MockTagRepository | |
| 162 | + | func (_mock *MockTagRepository) FindByID(ctx context.Context, id entity.TagID) (*entity.Tag, error) { | |
| 163 | + | ret := _mock.Called(ctx, id) | |
| 164 | + | ||
| 165 | + | if len(ret) == 0 { | |
| 166 | + | panic("no return value specified for FindByID") | |
| 167 | + | } | |
| 168 | + | ||
| 169 | + | var r0 *entity.Tag | |
| 170 | + | var r1 error | |
| 171 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID) (*entity.Tag, error)); ok { | |
| 172 | + | return returnFunc(ctx, id) | |
| 173 | + | } | |
| 174 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID) *entity.Tag); ok { | |
| 175 | + | r0 = returnFunc(ctx, id) | |
| 176 | + | } else { | |
| 177 | + | if ret.Get(0) != nil { | |
| 178 | + | r0 = ret.Get(0).(*entity.Tag) | |
| 179 | + | } | |
| 180 | + | } | |
| 181 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, entity.TagID) error); ok { | |
| 182 | + | r1 = returnFunc(ctx, id) | |
| 183 | + | } else { | |
| 184 | + | r1 = ret.Error(1) | |
| 185 | + | } | |
| 186 | + | return r0, r1 | |
| 187 | + | } | |
| 188 | + | ||
| 189 | + | // MockTagRepository_FindByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByID' | |
| 190 | + | type MockTagRepository_FindByID_Call struct { | |
| 191 | + | *mock.Call | |
| 192 | + | } | |
| 193 | + | ||
| 194 | + | // FindByID is a helper method to define mock.On call | |
| 195 | + | // - ctx context.Context | |
| 196 | + | // - id entity.TagID | |
| 197 | + | func (_e *MockTagRepository_Expecter) FindByID(ctx interface{}, id interface{}) *MockTagRepository_FindByID_Call { | |
| 198 | + | return &MockTagRepository_FindByID_Call{Call: _e.mock.On("FindByID", ctx, id)} | |
| 199 | + | } | |
| 200 | + | ||
| 201 | + | func (_c *MockTagRepository_FindByID_Call) Run(run func(ctx context.Context, id entity.TagID)) *MockTagRepository_FindByID_Call { | |
| 202 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 203 | + | var arg0 context.Context | |
| 204 | + | if args[0] != nil { | |
| 205 | + | arg0 = args[0].(context.Context) | |
| 206 | + | } | |
| 207 | + | var arg1 entity.TagID | |
| 208 | + | if args[1] != nil { | |
| 209 | + | arg1 = args[1].(entity.TagID) | |
| 210 | + | } | |
| 211 | + | run( | |
| 212 | + | arg0, | |
| 213 | + | arg1, | |
| 214 | + | ) | |
| 215 | + | }) | |
| 216 | + | return _c | |
| 217 | + | } | |
| 218 | + | ||
| 219 | + | func (_c *MockTagRepository_FindByID_Call) Return(tag *entity.Tag, err error) *MockTagRepository_FindByID_Call { | |
| 220 | + | _c.Call.Return(tag, err) | |
| 221 | + | return _c | |
| 222 | + | } | |
| 223 | + | ||
| 224 | + | func (_c *MockTagRepository_FindByID_Call) RunAndReturn(run func(ctx context.Context, id entity.TagID) (*entity.Tag, error)) *MockTagRepository_FindByID_Call { | |
| 225 | + | _c.Call.Return(run) | |
| 226 | + | return _c | |
| 227 | + | } | |
| 228 | + | ||
| 229 | + | // FindByName provides a mock function for the type MockTagRepository | |
| 230 | + | func (_mock *MockTagRepository) FindByName(ctx context.Context, name string) (*entity.Tag, error) { | |
| 231 | + | ret := _mock.Called(ctx, name) | |
| 232 | + | ||
| 233 | + | if len(ret) == 0 { | |
| 234 | + | panic("no return value specified for FindByName") | |
| 235 | + | } | |
| 236 | + | ||
| 237 | + | var r0 *entity.Tag | |
| 238 | + | var r1 error | |
| 239 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*entity.Tag, error)); ok { | |
| 240 | + | return returnFunc(ctx, name) | |
| 241 | + | } | |
| 242 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) *entity.Tag); ok { | |
| 243 | + | r0 = returnFunc(ctx, name) | |
| 244 | + | } else { | |
| 245 | + | if ret.Get(0) != nil { | |
| 246 | + | r0 = ret.Get(0).(*entity.Tag) | |
| 247 | + | } | |
| 248 | + | } | |
| 249 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { | |
| 250 | + | r1 = returnFunc(ctx, name) | |
| 251 | + | } else { | |
| 252 | + | r1 = ret.Error(1) | |
| 253 | + | } | |
| 254 | + | return r0, r1 | |
| 255 | + | } | |
| 256 | + | ||
| 257 | + | // MockTagRepository_FindByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByName' | |
| 258 | + | type MockTagRepository_FindByName_Call struct { | |
| 259 | + | *mock.Call | |
| 260 | + | } | |
| 261 | + | ||
| 262 | + | // FindByName is a helper method to define mock.On call | |
| 263 | + | // - ctx context.Context | |
| 264 | + | // - name string | |
| 265 | + | func (_e *MockTagRepository_Expecter) FindByName(ctx interface{}, name interface{}) *MockTagRepository_FindByName_Call { | |
| 266 | + | return &MockTagRepository_FindByName_Call{Call: _e.mock.On("FindByName", ctx, name)} | |
| 267 | + | } | |
| 268 | + | ||
| 269 | + | func (_c *MockTagRepository_FindByName_Call) Run(run func(ctx context.Context, name string)) *MockTagRepository_FindByName_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 | + | var arg1 string | |
| 276 | + | if args[1] != nil { | |
| 277 | + | arg1 = args[1].(string) | |
| 278 | + | } | |
| 279 | + | run( | |
| 280 | + | arg0, | |
| 281 | + | arg1, | |
| 282 | + | ) | |
| 283 | + | }) | |
| 284 | + | return _c | |
| 285 | + | } | |
| 286 | + | ||
| 287 | + | func (_c *MockTagRepository_FindByName_Call) Return(tag *entity.Tag, err error) *MockTagRepository_FindByName_Call { | |
| 288 | + | _c.Call.Return(tag, err) | |
| 289 | + | return _c | |
| 290 | + | } | |
| 291 | + | ||
| 292 | + | func (_c *MockTagRepository_FindByName_Call) RunAndReturn(run func(ctx context.Context, name string) (*entity.Tag, error)) *MockTagRepository_FindByName_Call { | |
| 293 | + | _c.Call.Return(run) | |
| 294 | + | return _c | |
| 295 | + | } | |
| 296 | + | ||
| 297 | + | // GetAll provides a mock function for the type MockTagRepository | |
| 298 | + | func (_mock *MockTagRepository) GetAll(ctx context.Context) ([]*entity.Tag, error) { | |
| 299 | + | ret := _mock.Called(ctx) | |
| 300 | + | ||
| 301 | + | if len(ret) == 0 { | |
| 302 | + | panic("no return value specified for GetAll") | |
| 303 | + | } | |
| 304 | + | ||
| 305 | + | var r0 []*entity.Tag | |
| 306 | + | var r1 error | |
| 307 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.Tag, error)); ok { | |
| 308 | + | return returnFunc(ctx) | |
| 309 | + | } | |
| 310 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.Tag); ok { | |
| 311 | + | r0 = returnFunc(ctx) | |
| 312 | + | } else { | |
| 313 | + | if ret.Get(0) != nil { | |
| 314 | + | r0 = ret.Get(0).([]*entity.Tag) | |
| 315 | + | } | |
| 316 | + | } | |
| 317 | + | if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { | |
| 318 | + | r1 = returnFunc(ctx) | |
| 319 | + | } else { | |
| 320 | + | r1 = ret.Error(1) | |
| 321 | + | } | |
| 322 | + | return r0, r1 | |
| 323 | + | } | |
| 324 | + | ||
| 325 | + | // MockTagRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' | |
| 326 | + | type MockTagRepository_GetAll_Call struct { | |
| 327 | + | *mock.Call | |
| 328 | + | } | |
| 329 | + | ||
| 330 | + | // GetAll is a helper method to define mock.On call | |
| 331 | + | // - ctx context.Context | |
| 332 | + | func (_e *MockTagRepository_Expecter) GetAll(ctx interface{}) *MockTagRepository_GetAll_Call { | |
| 333 | + | return &MockTagRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx)} | |
| 334 | + | } | |
| 335 | + | ||
| 336 | + | func (_c *MockTagRepository_GetAll_Call) Run(run func(ctx context.Context)) *MockTagRepository_GetAll_Call { | |
| 337 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 338 | + | var arg0 context.Context | |
| 339 | + | if args[0] != nil { | |
| 340 | + | arg0 = args[0].(context.Context) | |
| 341 | + | } | |
| 342 | + | run( | |
| 343 | + | arg0, | |
| 344 | + | ) | |
| 345 | + | }) | |
| 346 | + | return _c | |
| 347 | + | } | |
| 348 | + | ||
| 349 | + | func (_c *MockTagRepository_GetAll_Call) Return(tags []*entity.Tag, err error) *MockTagRepository_GetAll_Call { | |
| 350 | + | _c.Call.Return(tags, err) | |
| 351 | + | return _c | |
| 352 | + | } | |
| 353 | + | ||
| 354 | + | func (_c *MockTagRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.Tag, error)) *MockTagRepository_GetAll_Call { | |
| 355 | + | _c.Call.Return(run) | |
| 356 | + | return _c | |
| 357 | + | } | |
| 358 | + | ||
| 359 | + | // GetForFavorite provides a mock function for the type MockTagRepository | |
| 360 | + | func (_mock *MockTagRepository) GetForFavorite(ctx context.Context, favID entity.FavoriteID) ([]*entity.Tag, error) { | |
| 361 | + | ret := _mock.Called(ctx, favID) | |
| 362 | + | ||
| 363 | + | if len(ret) == 0 { | |
| 364 | + | panic("no return value specified for GetForFavorite") | |
| 365 | + | } | |
| 366 | + | ||
| 367 | + | var r0 []*entity.Tag | |
| 368 | + | var r1 error | |
| 369 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) ([]*entity.Tag, error)); ok { | |
| 370 | + | return returnFunc(ctx, favID) | |
| 371 | + | } | |
| 372 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) []*entity.Tag); ok { | |
| 373 | + | r0 = returnFunc(ctx, favID) | |
| 374 | + | } else { | |
| 375 | + | if ret.Get(0) != nil { | |
| 376 | + | r0 = ret.Get(0).([]*entity.Tag) | |
| 377 | + | } | |
| 378 | + | } | |
| 379 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, entity.FavoriteID) error); ok { | |
| 380 | + | r1 = returnFunc(ctx, favID) | |
| 381 | + | } else { | |
| 382 | + | r1 = ret.Error(1) | |
| 383 | + | } | |
| 384 | + | return r0, r1 | |
| 385 | + | } | |
| 386 | + | ||
| 387 | + | // MockTagRepository_GetForFavorite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetForFavorite' | |
| 388 | + | type MockTagRepository_GetForFavorite_Call struct { | |
| 389 | + | *mock.Call | |
| 390 | + | } | |
| 391 | + | ||
| 392 | + | // GetForFavorite is a helper method to define mock.On call | |
| 393 | + | // - ctx context.Context | |
| 394 | + | // - favID entity.FavoriteID | |
| 395 | + | func (_e *MockTagRepository_Expecter) GetForFavorite(ctx interface{}, favID interface{}) *MockTagRepository_GetForFavorite_Call { | |
| 396 | + | return &MockTagRepository_GetForFavorite_Call{Call: _e.mock.On("GetForFavorite", ctx, favID)} | |
| 397 | + | } | |
| 398 | + | ||
| 399 | + | func (_c *MockTagRepository_GetForFavorite_Call) Run(run func(ctx context.Context, favID entity.FavoriteID)) *MockTagRepository_GetForFavorite_Call { | |
| 400 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 401 | + | var arg0 context.Context | |
| 402 | + | if args[0] != nil { | |
| 403 | + | arg0 = args[0].(context.Context) | |
| 404 | + | } | |
| 405 | + | var arg1 entity.FavoriteID | |
| 406 | + | if args[1] != nil { | |
| 407 | + | arg1 = args[1].(entity.FavoriteID) | |
| 408 | + | } | |
| 409 | + | run( | |
| 410 | + | arg0, | |
| 411 | + | arg1, | |
| 412 | + | ) | |
| 413 | + | }) | |
| 414 | + | return _c | |
| 415 | + | } | |
| 416 | + | ||
| 417 | + | func (_c *MockTagRepository_GetForFavorite_Call) Return(tags []*entity.Tag, err error) *MockTagRepository_GetForFavorite_Call { | |
| 418 | + | _c.Call.Return(tags, err) | |
| 419 | + | return _c | |
| 420 | + | } | |
| 421 | + | ||
| 422 | + | func (_c *MockTagRepository_GetForFavorite_Call) RunAndReturn(run func(ctx context.Context, favID entity.FavoriteID) ([]*entity.Tag, error)) *MockTagRepository_GetForFavorite_Call { | |
| 423 | + | _c.Call.Return(run) | |
| 424 | + | return _c | |
| 425 | + | } | |
| 426 | + | ||
| 427 | + | // RemoveFromFavorite provides a mock function for the type MockTagRepository | |
| 428 | + | func (_mock *MockTagRepository) RemoveFromFavorite(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID) error { | |
| 429 | + | ret := _mock.Called(ctx, tagID, favID) | |
| 430 | + | ||
| 431 | + | if len(ret) == 0 { | |
| 432 | + | panic("no return value specified for RemoveFromFavorite") | |
| 433 | + | } | |
| 434 | + | ||
| 435 | + | var r0 error | |
| 436 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID, entity.FavoriteID) error); ok { | |
| 437 | + | r0 = returnFunc(ctx, tagID, favID) | |
| 438 | + | } else { | |
| 439 | + | r0 = ret.Error(0) | |
| 440 | + | } | |
| 441 | + | return r0 | |
| 442 | + | } | |
| 443 | + | ||
| 444 | + | // MockTagRepository_RemoveFromFavorite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveFromFavorite' | |
| 445 | + | type MockTagRepository_RemoveFromFavorite_Call struct { | |
| 446 | + | *mock.Call | |
| 447 | + | } | |
| 448 | + | ||
| 449 | + | // RemoveFromFavorite is a helper method to define mock.On call | |
| 450 | + | // - ctx context.Context | |
| 451 | + | // - tagID entity.TagID | |
| 452 | + | // - favID entity.FavoriteID | |
| 453 | + | func (_e *MockTagRepository_Expecter) RemoveFromFavorite(ctx interface{}, tagID interface{}, favID interface{}) *MockTagRepository_RemoveFromFavorite_Call { | |
| 454 | + | return &MockTagRepository_RemoveFromFavorite_Call{Call: _e.mock.On("RemoveFromFavorite", ctx, tagID, favID)} | |
| 455 | + | } | |
| 456 | + | ||
| 457 | + | func (_c *MockTagRepository_RemoveFromFavorite_Call) Run(run func(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID)) *MockTagRepository_RemoveFromFavorite_Call { | |
| 458 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 459 | + | var arg0 context.Context | |
| 460 | + | if args[0] != nil { | |
| 461 | + | arg0 = args[0].(context.Context) | |
| 462 | + | } | |
| 463 | + | var arg1 entity.TagID | |
| 464 | + | if args[1] != nil { | |
| 465 | + | arg1 = args[1].(entity.TagID) | |
| 466 | + | } | |
| 467 | + | var arg2 entity.FavoriteID | |
| 468 | + | if args[2] != nil { | |
| 469 | + | arg2 = args[2].(entity.FavoriteID) | |
| 470 | + | } | |
| 471 | + | run( | |
| 472 | + | arg0, | |
| 473 | + | arg1, | |
| 474 | + | arg2, | |
| 475 | + | ) | |
| 476 | + | }) | |
| 477 | + | return _c | |
| 478 | + | } | |
| 479 | + | ||
| 480 | + | func (_c *MockTagRepository_RemoveFromFavorite_Call) Return(err error) *MockTagRepository_RemoveFromFavorite_Call { | |
| 481 | + | _c.Call.Return(err) | |
| 482 | + | return _c | |
| 483 | + | } | |
| 484 | + | ||
| 485 | + | func (_c *MockTagRepository_RemoveFromFavorite_Call) RunAndReturn(run func(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID) error) *MockTagRepository_RemoveFromFavorite_Call { | |
| 486 | + | _c.Call.Return(run) | |
| 487 | + | return _c | |
| 488 | + | } | |
| 489 | + | ||
| 490 | + | // Save provides a mock function for the type MockTagRepository | |
| 491 | + | func (_mock *MockTagRepository) Save(ctx context.Context, tag *entity.Tag) error { | |
| 492 | + | ret := _mock.Called(ctx, tag) | |
| 493 | + | ||
| 494 | + | if len(ret) == 0 { | |
| 495 | + | panic("no return value specified for Save") | |
| 496 | + | } | |
| 497 | + | ||
| 498 | + | var r0 error | |
| 499 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.Tag) error); ok { | |
| 500 | + | r0 = returnFunc(ctx, tag) | |
| 501 | + | } else { | |
| 502 | + | r0 = ret.Error(0) | |
| 503 | + | } | |
| 504 | + | return r0 | |
| 505 | + | } | |
| 506 | + | ||
| 507 | + | // MockTagRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' | |
| 508 | + | type MockTagRepository_Save_Call struct { | |
| 509 | + | *mock.Call | |
| 510 | + | } | |
| 511 | + | ||
| 512 | + | // Save is a helper method to define mock.On call | |
| 513 | + | // - ctx context.Context | |
| 514 | + | // - tag *entity.Tag | |
| 515 | + | func (_e *MockTagRepository_Expecter) Save(ctx interface{}, tag interface{}) *MockTagRepository_Save_Call { | |
| 516 | + | return &MockTagRepository_Save_Call{Call: _e.mock.On("Save", ctx, tag)} | |
| 517 | + | } | |
| 518 | + | ||
| 519 | + | func (_c *MockTagRepository_Save_Call) Run(run func(ctx context.Context, tag *entity.Tag)) *MockTagRepository_Save_Call { | |
| 520 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 521 | + | var arg0 context.Context | |
| 522 | + | if args[0] != nil { | |
| 523 | + | arg0 = args[0].(context.Context) | |
| 524 | + | } | |
| 525 | + | var arg1 *entity.Tag | |
| 526 | + | if args[1] != nil { | |
| 527 | + | arg1 = args[1].(*entity.Tag) | |
| 528 | + | } | |
| 529 | + | run( | |
| 530 | + | arg0, | |
| 531 | + | arg1, | |
| 532 | + | ) | |
| 533 | + | }) | |
| 534 | + | return _c | |
| 535 | + | } | |
| 536 | + | ||
| 537 | + | func (_c *MockTagRepository_Save_Call) Return(err error) *MockTagRepository_Save_Call { | |
| 538 | + | _c.Call.Return(err) | |
| 539 | + | return _c | |
| 540 | + | } | |
| 541 | + | ||
| 542 | + | func (_c *MockTagRepository_Save_Call) RunAndReturn(run func(ctx context.Context, tag *entity.Tag) error) *MockTagRepository_Save_Call { | |
| 543 | + | _c.Call.Return(run) | |
| 544 | + | return _c | |
| 545 | + | } | |
| @@ -0,0 +1,545 @@ | |||||
| 1 | + | // Code generated by mockery; DO NOT EDIT. | |||
| 2 | + | // github.com/vektra/mockery | |||
| 3 | + | // template: testify | |||
| 4 | + | ||||
| 5 | + | package mocks | |||
| 6 | + | ||||
| 7 | + | import ( | |||
| 8 | + | "context" | |||
| 9 | + | ||||
| 10 | + | "github.com/bnema/dumber/internal/domain/entity" | |||
| 11 | + | mock "github.com/stretchr/testify/mock" | |||
| 12 | + | ) | |||
| 13 | + | ||||
| 14 | + | // NewMockTagRepository creates a new instance of MockTagRepository. 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. | |||
| 16 | + | func NewMockTagRepository(t interface { | |||
| 17 | + | mock.TestingT | |||
| 18 | + | Cleanup(func()) | |||
| 19 | + | }) *MockTagRepository { | |||
| 20 | + | mock := &MockTagRepository{} | |||
| 21 | + | mock.Mock.Test(t) | |||
| 22 | + | ||||
| 23 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |||
| 24 | + | ||||
| 25 | + | return mock | |||
| 26 | + | } | |||
| 27 | + | ||||
| 28 | + | // MockTagRepository is an autogenerated mock type for the TagRepository type | |||
| 29 | + | type MockTagRepository struct { | |||
| 30 | + | mock.Mock | |||
| 31 | + | } | |||
| 32 | + | ||||
| 33 | + | type MockTagRepository_Expecter struct { | |||
| 34 | + | mock *mock.Mock | |||
| 35 | + | } | |||
| 36 | + | ||||
| 37 | + | func (_m *MockTagRepository) EXPECT() *MockTagRepository_Expecter { | |||
| 38 | + | return &MockTagRepository_Expecter{mock: &_m.Mock} | |||
| 39 | + | } | |||
| 40 | + | ||||
| 41 | + | // AssignToFavorite provides a mock function for the type MockTagRepository | |||
| 42 | + | func (_mock *MockTagRepository) AssignToFavorite(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID) error { | |||
| 43 | + | ret := _mock.Called(ctx, tagID, favID) | |||
| 44 | + | ||||
| 45 | + | if len(ret) == 0 { | |||
| 46 | + | panic("no return value specified for AssignToFavorite") | |||
| 47 | + | } | |||
| 48 | + | ||||
| 49 | + | var r0 error | |||
| 50 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID, entity.FavoriteID) error); ok { | |||
| 51 | + | r0 = returnFunc(ctx, tagID, favID) | |||
| 52 | + | } else { | |||
| 53 | + | r0 = ret.Error(0) | |||
| 54 | + | } | |||
| 55 | + | return r0 | |||
| 56 | + | } | |||
| 57 | + | ||||
| 58 | + | // MockTagRepository_AssignToFavorite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AssignToFavorite' | |||
| 59 | + | type MockTagRepository_AssignToFavorite_Call struct { | |||
| 60 | + | *mock.Call | |||
| 61 | + | } | |||
| 62 | + | ||||
| 63 | + | // AssignToFavorite is a helper method to define mock.On call | |||
| 64 | + | // - ctx context.Context | |||
| 65 | + | // - tagID entity.TagID | |||
| 66 | + | // - favID entity.FavoriteID | |||
| 67 | + | func (_e *MockTagRepository_Expecter) AssignToFavorite(ctx interface{}, tagID interface{}, favID interface{}) *MockTagRepository_AssignToFavorite_Call { | |||
| 68 | + | return &MockTagRepository_AssignToFavorite_Call{Call: _e.mock.On("AssignToFavorite", ctx, tagID, favID)} | |||
| 69 | + | } | |||
| 70 | + | ||||
| 71 | + | func (_c *MockTagRepository_AssignToFavorite_Call) Run(run func(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID)) *MockTagRepository_AssignToFavorite_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 entity.TagID | |||
| 78 | + | if args[1] != nil { | |||
| 79 | + | arg1 = args[1].(entity.TagID) | |||
| 80 | + | } | |||
| 81 | + | var arg2 entity.FavoriteID | |||
| 82 | + | if args[2] != nil { | |||
| 83 | + | arg2 = args[2].(entity.FavoriteID) | |||
| 84 | + | } | |||
| 85 | + | run( | |||
| 86 | + | arg0, | |||
| 87 | + | arg1, | |||
| 88 | + | arg2, | |||
| 89 | + | ) | |||
| 90 | + | }) | |||
| 91 | + | return _c | |||
| 92 | + | } | |||
| 93 | + | ||||
| 94 | + | func (_c *MockTagRepository_AssignToFavorite_Call) Return(err error) *MockTagRepository_AssignToFavorite_Call { | |||
| 95 | + | _c.Call.Return(err) | |||
| 96 | + | return _c | |||
| 97 | + | } | |||
| 98 | + | ||||
| 99 | + | func (_c *MockTagRepository_AssignToFavorite_Call) RunAndReturn(run func(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID) error) *MockTagRepository_AssignToFavorite_Call { | |||
| 100 | + | _c.Call.Return(run) | |||
| 101 | + | return _c | |||
| 102 | + | } | |||
| 103 | + | ||||
| 104 | + | // Delete provides a mock function for the type MockTagRepository | |||
| 105 | + | func (_mock *MockTagRepository) Delete(ctx context.Context, id entity.TagID) error { | |||
| 106 | + | ret := _mock.Called(ctx, id) | |||
| 107 | + | ||||
| 108 | + | if len(ret) == 0 { | |||
| 109 | + | panic("no return value specified for Delete") | |||
| 110 | + | } | |||
| 111 | + | ||||
| 112 | + | var r0 error | |||
| 113 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID) error); ok { | |||
| 114 | + | r0 = returnFunc(ctx, id) | |||
| 115 | + | } else { | |||
| 116 | + | r0 = ret.Error(0) | |||
| 117 | + | } | |||
| 118 | + | return r0 | |||
| 119 | + | } | |||
| 120 | + | ||||
| 121 | + | // MockTagRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' | |||
| 122 | + | type MockTagRepository_Delete_Call struct { | |||
| 123 | + | *mock.Call | |||
| 124 | + | } | |||
| 125 | + | ||||
| 126 | + | // Delete is a helper method to define mock.On call | |||
| 127 | + | // - ctx context.Context | |||
| 128 | + | // - id entity.TagID | |||
| 129 | + | func (_e *MockTagRepository_Expecter) Delete(ctx interface{}, id interface{}) *MockTagRepository_Delete_Call { | |||
| 130 | + | return &MockTagRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} | |||
| 131 | + | } | |||
| 132 | + | ||||
| 133 | + | func (_c *MockTagRepository_Delete_Call) Run(run func(ctx context.Context, id entity.TagID)) *MockTagRepository_Delete_Call { | |||
| 134 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 135 | + | var arg0 context.Context | |||
| 136 | + | if args[0] != nil { | |||
| 137 | + | arg0 = args[0].(context.Context) | |||
| 138 | + | } | |||
| 139 | + | var arg1 entity.TagID | |||
| 140 | + | if args[1] != nil { | |||
| 141 | + | arg1 = args[1].(entity.TagID) | |||
| 142 | + | } | |||
| 143 | + | run( | |||
| 144 | + | arg0, | |||
| 145 | + | arg1, | |||
| 146 | + | ) | |||
| 147 | + | }) | |||
| 148 | + | return _c | |||
| 149 | + | } | |||
| 150 | + | ||||
| 151 | + | func (_c *MockTagRepository_Delete_Call) Return(err error) *MockTagRepository_Delete_Call { | |||
| 152 | + | _c.Call.Return(err) | |||
| 153 | + | return _c | |||
| 154 | + | } | |||
| 155 | + | ||||
| 156 | + | func (_c *MockTagRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, id entity.TagID) error) *MockTagRepository_Delete_Call { | |||
| 157 | + | _c.Call.Return(run) | |||
| 158 | + | return _c | |||
| 159 | + | } | |||
| 160 | + | ||||
| 161 | + | // FindByID provides a mock function for the type MockTagRepository | |||
| 162 | + | func (_mock *MockTagRepository) FindByID(ctx context.Context, id entity.TagID) (*entity.Tag, error) { | |||
| 163 | + | ret := _mock.Called(ctx, id) | |||
| 164 | + | ||||
| 165 | + | if len(ret) == 0 { | |||
| 166 | + | panic("no return value specified for FindByID") | |||
| 167 | + | } | |||
| 168 | + | ||||
| 169 | + | var r0 *entity.Tag | |||
| 170 | + | var r1 error | |||
| 171 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID) (*entity.Tag, error)); ok { | |||
| 172 | + | return returnFunc(ctx, id) | |||
| 173 | + | } | |||
| 174 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID) *entity.Tag); ok { | |||
| 175 | + | r0 = returnFunc(ctx, id) | |||
| 176 | + | } else { | |||
| 177 | + | if ret.Get(0) != nil { | |||
| 178 | + | r0 = ret.Get(0).(*entity.Tag) | |||
| 179 | + | } | |||
| 180 | + | } | |||
| 181 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, entity.TagID) error); ok { | |||
| 182 | + | r1 = returnFunc(ctx, id) | |||
| 183 | + | } else { | |||
| 184 | + | r1 = ret.Error(1) | |||
| 185 | + | } | |||
| 186 | + | return r0, r1 | |||
| 187 | + | } | |||
| 188 | + | ||||
| 189 | + | // MockTagRepository_FindByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByID' | |||
| 190 | + | type MockTagRepository_FindByID_Call struct { | |||
| 191 | + | *mock.Call | |||
| 192 | + | } | |||
| 193 | + | ||||
| 194 | + | // FindByID is a helper method to define mock.On call | |||
| 195 | + | // - ctx context.Context | |||
| 196 | + | // - id entity.TagID | |||
| 197 | + | func (_e *MockTagRepository_Expecter) FindByID(ctx interface{}, id interface{}) *MockTagRepository_FindByID_Call { | |||
| 198 | + | return &MockTagRepository_FindByID_Call{Call: _e.mock.On("FindByID", ctx, id)} | |||
| 199 | + | } | |||
| 200 | + | ||||
| 201 | + | func (_c *MockTagRepository_FindByID_Call) Run(run func(ctx context.Context, id entity.TagID)) *MockTagRepository_FindByID_Call { | |||
| 202 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 203 | + | var arg0 context.Context | |||
| 204 | + | if args[0] != nil { | |||
| 205 | + | arg0 = args[0].(context.Context) | |||
| 206 | + | } | |||
| 207 | + | var arg1 entity.TagID | |||
| 208 | + | if args[1] != nil { | |||
| 209 | + | arg1 = args[1].(entity.TagID) | |||
| 210 | + | } | |||
| 211 | + | run( | |||
| 212 | + | arg0, | |||
| 213 | + | arg1, | |||
| 214 | + | ) | |||
| 215 | + | }) | |||
| 216 | + | return _c | |||
| 217 | + | } | |||
| 218 | + | ||||
| 219 | + | func (_c *MockTagRepository_FindByID_Call) Return(tag *entity.Tag, err error) *MockTagRepository_FindByID_Call { | |||
| 220 | + | _c.Call.Return(tag, err) | |||
| 221 | + | return _c | |||
| 222 | + | } | |||
| 223 | + | ||||
| 224 | + | func (_c *MockTagRepository_FindByID_Call) RunAndReturn(run func(ctx context.Context, id entity.TagID) (*entity.Tag, error)) *MockTagRepository_FindByID_Call { | |||
| 225 | + | _c.Call.Return(run) | |||
| 226 | + | return _c | |||
| 227 | + | } | |||
| 228 | + | ||||
| 229 | + | // FindByName provides a mock function for the type MockTagRepository | |||
| 230 | + | func (_mock *MockTagRepository) FindByName(ctx context.Context, name string) (*entity.Tag, error) { | |||
| 231 | + | ret := _mock.Called(ctx, name) | |||
| 232 | + | ||||
| 233 | + | if len(ret) == 0 { | |||
| 234 | + | panic("no return value specified for FindByName") | |||
| 235 | + | } | |||
| 236 | + | ||||
| 237 | + | var r0 *entity.Tag | |||
| 238 | + | var r1 error | |||
| 239 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*entity.Tag, error)); ok { | |||
| 240 | + | return returnFunc(ctx, name) | |||
| 241 | + | } | |||
| 242 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) *entity.Tag); ok { | |||
| 243 | + | r0 = returnFunc(ctx, name) | |||
| 244 | + | } else { | |||
| 245 | + | if ret.Get(0) != nil { | |||
| 246 | + | r0 = ret.Get(0).(*entity.Tag) | |||
| 247 | + | } | |||
| 248 | + | } | |||
| 249 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { | |||
| 250 | + | r1 = returnFunc(ctx, name) | |||
| 251 | + | } else { | |||
| 252 | + | r1 = ret.Error(1) | |||
| 253 | + | } | |||
| 254 | + | return r0, r1 | |||
| 255 | + | } | |||
| 256 | + | ||||
| 257 | + | // MockTagRepository_FindByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByName' | |||
| 258 | + | type MockTagRepository_FindByName_Call struct { | |||
| 259 | + | *mock.Call | |||
| 260 | + | } | |||
| 261 | + | ||||
| 262 | + | // FindByName is a helper method to define mock.On call | |||
| 263 | + | // - ctx context.Context | |||
| 264 | + | // - name string | |||
| 265 | + | func (_e *MockTagRepository_Expecter) FindByName(ctx interface{}, name interface{}) *MockTagRepository_FindByName_Call { | |||
| 266 | + | return &MockTagRepository_FindByName_Call{Call: _e.mock.On("FindByName", ctx, name)} | |||
| 267 | + | } | |||
| 268 | + | ||||
| 269 | + | func (_c *MockTagRepository_FindByName_Call) Run(run func(ctx context.Context, name string)) *MockTagRepository_FindByName_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 | + | var arg1 string | |||
| 276 | + | if args[1] != nil { | |||
| 277 | + | arg1 = args[1].(string) | |||
| 278 | + | } | |||
| 279 | + | run( | |||
| 280 | + | arg0, | |||
| 281 | + | arg1, | |||
| 282 | + | ) | |||
| 283 | + | }) | |||
| 284 | + | return _c | |||
| 285 | + | } | |||
| 286 | + | ||||
| 287 | + | func (_c *MockTagRepository_FindByName_Call) Return(tag *entity.Tag, err error) *MockTagRepository_FindByName_Call { | |||
| 288 | + | _c.Call.Return(tag, err) | |||
| 289 | + | return _c | |||
| 290 | + | } | |||
| 291 | + | ||||
| 292 | + | func (_c *MockTagRepository_FindByName_Call) RunAndReturn(run func(ctx context.Context, name string) (*entity.Tag, error)) *MockTagRepository_FindByName_Call { | |||
| 293 | + | _c.Call.Return(run) | |||
| 294 | + | return _c | |||
| 295 | + | } | |||
| 296 | + | ||||
| 297 | + | // GetAll provides a mock function for the type MockTagRepository | |||
| 298 | + | func (_mock *MockTagRepository) GetAll(ctx context.Context) ([]*entity.Tag, error) { | |||
| 299 | + | ret := _mock.Called(ctx) | |||
| 300 | + | ||||
| 301 | + | if len(ret) == 0 { | |||
| 302 | + | panic("no return value specified for GetAll") | |||
| 303 | + | } | |||
| 304 | + | ||||
| 305 | + | var r0 []*entity.Tag | |||
| 306 | + | var r1 error | |||
| 307 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.Tag, error)); ok { | |||
| 308 | + | return returnFunc(ctx) | |||
| 309 | + | } | |||
| 310 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.Tag); ok { | |||
| 311 | + | r0 = returnFunc(ctx) | |||
| 312 | + | } else { | |||
| 313 | + | if ret.Get(0) != nil { | |||
| 314 | + | r0 = ret.Get(0).([]*entity.Tag) | |||
| 315 | + | } | |||
| 316 | + | } | |||
| 317 | + | if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { | |||
| 318 | + | r1 = returnFunc(ctx) | |||
| 319 | + | } else { | |||
| 320 | + | r1 = ret.Error(1) | |||
| 321 | + | } | |||
| 322 | + | return r0, r1 | |||
| 323 | + | } | |||
| 324 | + | ||||
| 325 | + | // MockTagRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' | |||
| 326 | + | type MockTagRepository_GetAll_Call struct { | |||
| 327 | + | *mock.Call | |||
| 328 | + | } | |||
| 329 | + | ||||
| 330 | + | // GetAll is a helper method to define mock.On call | |||
| 331 | + | // - ctx context.Context | |||
| 332 | + | func (_e *MockTagRepository_Expecter) GetAll(ctx interface{}) *MockTagRepository_GetAll_Call { | |||
| 333 | + | return &MockTagRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx)} | |||
| 334 | + | } | |||
| 335 | + | ||||
| 336 | + | func (_c *MockTagRepository_GetAll_Call) Run(run func(ctx context.Context)) *MockTagRepository_GetAll_Call { | |||
| 337 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 338 | + | var arg0 context.Context | |||
| 339 | + | if args[0] != nil { | |||
| 340 | + | arg0 = args[0].(context.Context) | |||
| 341 | + | } | |||
| 342 | + | run( | |||
| 343 | + | arg0, | |||
| 344 | + | ) | |||
| 345 | + | }) | |||
| 346 | + | return _c | |||
| 347 | + | } | |||
| 348 | + | ||||
| 349 | + | func (_c *MockTagRepository_GetAll_Call) Return(tags []*entity.Tag, err error) *MockTagRepository_GetAll_Call { | |||
| 350 | + | _c.Call.Return(tags, err) | |||
| 351 | + | return _c | |||
| 352 | + | } | |||
| 353 | + | ||||
| 354 | + | func (_c *MockTagRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.Tag, error)) *MockTagRepository_GetAll_Call { | |||
| 355 | + | _c.Call.Return(run) | |||
| 356 | + | return _c | |||
| 357 | + | } | |||
| 358 | + | ||||
| 359 | + | // GetForFavorite provides a mock function for the type MockTagRepository | |||
| 360 | + | func (_mock *MockTagRepository) GetForFavorite(ctx context.Context, favID entity.FavoriteID) ([]*entity.Tag, error) { | |||
| 361 | + | ret := _mock.Called(ctx, favID) | |||
| 362 | + | ||||
| 363 | + | if len(ret) == 0 { | |||
| 364 | + | panic("no return value specified for GetForFavorite") | |||
| 365 | + | } | |||
| 366 | + | ||||
| 367 | + | var r0 []*entity.Tag | |||
| 368 | + | var r1 error | |||
| 369 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) ([]*entity.Tag, error)); ok { | |||
| 370 | + | return returnFunc(ctx, favID) | |||
| 371 | + | } | |||
| 372 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.FavoriteID) []*entity.Tag); ok { | |||
| 373 | + | r0 = returnFunc(ctx, favID) | |||
| 374 | + | } else { | |||
| 375 | + | if ret.Get(0) != nil { | |||
| 376 | + | r0 = ret.Get(0).([]*entity.Tag) | |||
| 377 | + | } | |||
| 378 | + | } | |||
| 379 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, entity.FavoriteID) error); ok { | |||
| 380 | + | r1 = returnFunc(ctx, favID) | |||
| 381 | + | } else { | |||
| 382 | + | r1 = ret.Error(1) | |||
| 383 | + | } | |||
| 384 | + | return r0, r1 | |||
| 385 | + | } | |||
| 386 | + | ||||
| 387 | + | // MockTagRepository_GetForFavorite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetForFavorite' | |||
| 388 | + | type MockTagRepository_GetForFavorite_Call struct { | |||
| 389 | + | *mock.Call | |||
| 390 | + | } | |||
| 391 | + | ||||
| 392 | + | // GetForFavorite is a helper method to define mock.On call | |||
| 393 | + | // - ctx context.Context | |||
| 394 | + | // - favID entity.FavoriteID | |||
| 395 | + | func (_e *MockTagRepository_Expecter) GetForFavorite(ctx interface{}, favID interface{}) *MockTagRepository_GetForFavorite_Call { | |||
| 396 | + | return &MockTagRepository_GetForFavorite_Call{Call: _e.mock.On("GetForFavorite", ctx, favID)} | |||
| 397 | + | } | |||
| 398 | + | ||||
| 399 | + | func (_c *MockTagRepository_GetForFavorite_Call) Run(run func(ctx context.Context, favID entity.FavoriteID)) *MockTagRepository_GetForFavorite_Call { | |||
| 400 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 401 | + | var arg0 context.Context | |||
| 402 | + | if args[0] != nil { | |||
| 403 | + | arg0 = args[0].(context.Context) | |||
| 404 | + | } | |||
| 405 | + | var arg1 entity.FavoriteID | |||
| 406 | + | if args[1] != nil { | |||
| 407 | + | arg1 = args[1].(entity.FavoriteID) | |||
| 408 | + | } | |||
| 409 | + | run( | |||
| 410 | + | arg0, | |||
| 411 | + | arg1, | |||
| 412 | + | ) | |||
| 413 | + | }) | |||
| 414 | + | return _c | |||
| 415 | + | } | |||
| 416 | + | ||||
| 417 | + | func (_c *MockTagRepository_GetForFavorite_Call) Return(tags []*entity.Tag, err error) *MockTagRepository_GetForFavorite_Call { | |||
| 418 | + | _c.Call.Return(tags, err) | |||
| 419 | + | return _c | |||
| 420 | + | } | |||
| 421 | + | ||||
| 422 | + | func (_c *MockTagRepository_GetForFavorite_Call) RunAndReturn(run func(ctx context.Context, favID entity.FavoriteID) ([]*entity.Tag, error)) *MockTagRepository_GetForFavorite_Call { | |||
| 423 | + | _c.Call.Return(run) | |||
| 424 | + | return _c | |||
| 425 | + | } | |||
| 426 | + | ||||
| 427 | + | // RemoveFromFavorite provides a mock function for the type MockTagRepository | |||
| 428 | + | func (_mock *MockTagRepository) RemoveFromFavorite(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID) error { | |||
| 429 | + | ret := _mock.Called(ctx, tagID, favID) | |||
| 430 | + | ||||
| 431 | + | if len(ret) == 0 { | |||
| 432 | + | panic("no return value specified for RemoveFromFavorite") | |||
| 433 | + | } | |||
| 434 | + | ||||
| 435 | + | var r0 error | |||
| 436 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, entity.TagID, entity.FavoriteID) error); ok { | |||
| 437 | + | r0 = returnFunc(ctx, tagID, favID) | |||
| 438 | + | } else { | |||
| 439 | + | r0 = ret.Error(0) | |||
| 440 | + | } | |||
| 441 | + | return r0 | |||
| 442 | + | } | |||
| 443 | + | ||||
| 444 | + | // MockTagRepository_RemoveFromFavorite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveFromFavorite' | |||
| 445 | + | type MockTagRepository_RemoveFromFavorite_Call struct { | |||
| 446 | + | *mock.Call | |||
| 447 | + | } | |||
| 448 | + | ||||
| 449 | + | // RemoveFromFavorite is a helper method to define mock.On call | |||
| 450 | + | // - ctx context.Context | |||
| 451 | + | // - tagID entity.TagID | |||
| 452 | + | // - favID entity.FavoriteID | |||
| 453 | + | func (_e *MockTagRepository_Expecter) RemoveFromFavorite(ctx interface{}, tagID interface{}, favID interface{}) *MockTagRepository_RemoveFromFavorite_Call { | |||
| 454 | + | return &MockTagRepository_RemoveFromFavorite_Call{Call: _e.mock.On("RemoveFromFavorite", ctx, tagID, favID)} | |||
| 455 | + | } | |||
| 456 | + | ||||
| 457 | + | func (_c *MockTagRepository_RemoveFromFavorite_Call) Run(run func(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID)) *MockTagRepository_RemoveFromFavorite_Call { | |||
| 458 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 459 | + | var arg0 context.Context | |||
| 460 | + | if args[0] != nil { | |||
| 461 | + | arg0 = args[0].(context.Context) | |||
| 462 | + | } | |||
| 463 | + | var arg1 entity.TagID | |||
| 464 | + | if args[1] != nil { | |||
| 465 | + | arg1 = args[1].(entity.TagID) | |||
| 466 | + | } | |||
| 467 | + | var arg2 entity.FavoriteID | |||
| 468 | + | if args[2] != nil { | |||
| 469 | + | arg2 = args[2].(entity.FavoriteID) | |||
| 470 | + | } | |||
| 471 | + | run( | |||
| 472 | + | arg0, | |||
| 473 | + | arg1, | |||
| 474 | + | arg2, | |||
| 475 | + | ) | |||
| 476 | + | }) | |||
| 477 | + | return _c | |||
| 478 | + | } | |||
| 479 | + | ||||
| 480 | + | func (_c *MockTagRepository_RemoveFromFavorite_Call) Return(err error) *MockTagRepository_RemoveFromFavorite_Call { | |||
| 481 | + | _c.Call.Return(err) | |||
| 482 | + | return _c | |||
| 483 | + | } | |||
| 484 | + | ||||
| 485 | + | func (_c *MockTagRepository_RemoveFromFavorite_Call) RunAndReturn(run func(ctx context.Context, tagID entity.TagID, favID entity.FavoriteID) error) *MockTagRepository_RemoveFromFavorite_Call { | |||
| 486 | + | _c.Call.Return(run) | |||
| 487 | + | return _c | |||
| 488 | + | } | |||
| 489 | + | ||||
| 490 | + | // Save provides a mock function for the type MockTagRepository | |||
| 491 | + | func (_mock *MockTagRepository) Save(ctx context.Context, tag *entity.Tag) error { | |||
| 492 | + | ret := _mock.Called(ctx, tag) | |||
| 493 | + | ||||
| 494 | + | if len(ret) == 0 { | |||
| 495 | + | panic("no return value specified for Save") | |||
| 496 | + | } | |||
| 497 | + | ||||
| 498 | + | var r0 error | |||
| 499 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.Tag) error); ok { | |||
| 500 | + | r0 = returnFunc(ctx, tag) | |||
| 501 | + | } else { | |||
| 502 | + | r0 = ret.Error(0) | |||
| 503 | + | } | |||
| 504 | + | return r0 | |||
| 505 | + | } | |||
| 506 | + | ||||
| 507 | + | // MockTagRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' | |||
| 508 | + | type MockTagRepository_Save_Call struct { | |||
| 509 | + | *mock.Call | |||
| 510 | + | } | |||
| 511 | + | ||||
| 512 | + | // Save is a helper method to define mock.On call | |||
| 513 | + | // - ctx context.Context | |||
| 514 | + | // - tag *entity.Tag | |||
| 515 | + | func (_e *MockTagRepository_Expecter) Save(ctx interface{}, tag interface{}) *MockTagRepository_Save_Call { | |||
| 516 | + | return &MockTagRepository_Save_Call{Call: _e.mock.On("Save", ctx, tag)} | |||
| 517 | + | } | |||
| 518 | + | ||||
| 519 | + | func (_c *MockTagRepository_Save_Call) Run(run func(ctx context.Context, tag *entity.Tag)) *MockTagRepository_Save_Call { | |||
| 520 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 521 | + | var arg0 context.Context | |||
| 522 | + | if args[0] != nil { | |||
| 523 | + | arg0 = args[0].(context.Context) | |||
| 524 | + | } | |||
| 525 | + | var arg1 *entity.Tag | |||
| 526 | + | if args[1] != nil { | |||
| 527 | + | arg1 = args[1].(*entity.Tag) | |||
| 528 | + | } | |||
| 529 | + | run( | |||
| 530 | + | arg0, | |||
| 531 | + | arg1, | |||
| 532 | + | ) | |||
| 533 | + | }) | |||
| 534 | + | return _c | |||
| 535 | + | } | |||
| 536 | + | ||||
| 537 | + | func (_c *MockTagRepository_Save_Call) Return(err error) *MockTagRepository_Save_Call { | |||
| 538 | + | _c.Call.Return(err) | |||
| 539 | + | return _c | |||
| 540 | + | } | |||
| 541 | + | ||||
| 542 | + | func (_c *MockTagRepository_Save_Call) RunAndReturn(run func(ctx context.Context, tag *entity.Tag) error) *MockTagRepository_Save_Call { | |||
| 543 | + | _c.Call.Return(run) | |||
| 544 | + | return _c | |||
| 545 | + | } | |||
A internal/domain/repository/mocks/mock_zoom_repository.go +283 -0
| @@ -0,0 +1,283 @@ | |||
| 1 | + | // Code generated by mockery; DO NOT EDIT. | |
| 2 | + | // github.com/vektra/mockery | |
| 3 | + | // template: testify | |
| 4 | + | ||
| 5 | + | package mocks | |
| 6 | + | ||
| 7 | + | import ( | |
| 8 | + | "context" | |
| 9 | + | ||
| 10 | + | "github.com/bnema/dumber/internal/domain/entity" | |
| 11 | + | mock "github.com/stretchr/testify/mock" | |
| 12 | + | ) | |
| 13 | + | ||
| 14 | + | // NewMockZoomRepository creates a new instance of MockZoomRepository. 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. | |
| 16 | + | func NewMockZoomRepository(t interface { | |
| 17 | + | mock.TestingT | |
| 18 | + | Cleanup(func()) | |
| 19 | + | }) *MockZoomRepository { | |
| 20 | + | mock := &MockZoomRepository{} | |
| 21 | + | mock.Mock.Test(t) | |
| 22 | + | ||
| 23 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |
| 24 | + | ||
| 25 | + | return mock | |
| 26 | + | } | |
| 27 | + | ||
| 28 | + | // MockZoomRepository is an autogenerated mock type for the ZoomRepository type | |
| 29 | + | type MockZoomRepository struct { | |
| 30 | + | mock.Mock | |
| 31 | + | } | |
| 32 | + | ||
| 33 | + | type MockZoomRepository_Expecter struct { | |
| 34 | + | mock *mock.Mock | |
| 35 | + | } | |
| 36 | + | ||
| 37 | + | func (_m *MockZoomRepository) EXPECT() *MockZoomRepository_Expecter { | |
| 38 | + | return &MockZoomRepository_Expecter{mock: &_m.Mock} | |
| 39 | + | } | |
| 40 | + | ||
| 41 | + | // Delete provides a mock function for the type MockZoomRepository | |
| 42 | + | func (_mock *MockZoomRepository) Delete(ctx context.Context, domain string) error { | |
| 43 | + | ret := _mock.Called(ctx, domain) | |
| 44 | + | ||
| 45 | + | if len(ret) == 0 { | |
| 46 | + | panic("no return value specified for Delete") | |
| 47 | + | } | |
| 48 | + | ||
| 49 | + | var r0 error | |
| 50 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { | |
| 51 | + | r0 = returnFunc(ctx, domain) | |
| 52 | + | } else { | |
| 53 | + | r0 = ret.Error(0) | |
| 54 | + | } | |
| 55 | + | return r0 | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | // MockZoomRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' | |
| 59 | + | type MockZoomRepository_Delete_Call struct { | |
| 60 | + | *mock.Call | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | // Delete is a helper method to define mock.On call | |
| 64 | + | // - ctx context.Context | |
| 65 | + | // - domain string | |
| 66 | + | func (_e *MockZoomRepository_Expecter) Delete(ctx interface{}, domain interface{}) *MockZoomRepository_Delete_Call { | |
| 67 | + | return &MockZoomRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, domain)} | |
| 68 | + | } | |
| 69 | + | ||
| 70 | + | func (_c *MockZoomRepository_Delete_Call) Run(run func(ctx context.Context, domain string)) *MockZoomRepository_Delete_Call { | |
| 71 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 72 | + | var arg0 context.Context | |
| 73 | + | if args[0] != nil { | |
| 74 | + | arg0 = args[0].(context.Context) | |
| 75 | + | } | |
| 76 | + | var arg1 string | |
| 77 | + | if args[1] != nil { | |
| 78 | + | arg1 = args[1].(string) | |
| 79 | + | } | |
| 80 | + | run( | |
| 81 | + | arg0, | |
| 82 | + | arg1, | |
| 83 | + | ) | |
| 84 | + | }) | |
| 85 | + | return _c | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | func (_c *MockZoomRepository_Delete_Call) Return(err error) *MockZoomRepository_Delete_Call { | |
| 89 | + | _c.Call.Return(err) | |
| 90 | + | return _c | |
| 91 | + | } | |
| 92 | + | ||
| 93 | + | func (_c *MockZoomRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, domain string) error) *MockZoomRepository_Delete_Call { | |
| 94 | + | _c.Call.Return(run) | |
| 95 | + | return _c | |
| 96 | + | } | |
| 97 | + | ||
| 98 | + | // Get provides a mock function for the type MockZoomRepository | |
| 99 | + | func (_mock *MockZoomRepository) Get(ctx context.Context, domain string) (*entity.ZoomLevel, error) { | |
| 100 | + | ret := _mock.Called(ctx, domain) | |
| 101 | + | ||
| 102 | + | if len(ret) == 0 { | |
| 103 | + | panic("no return value specified for Get") | |
| 104 | + | } | |
| 105 | + | ||
| 106 | + | var r0 *entity.ZoomLevel | |
| 107 | + | var r1 error | |
| 108 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*entity.ZoomLevel, error)); ok { | |
| 109 | + | return returnFunc(ctx, domain) | |
| 110 | + | } | |
| 111 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) *entity.ZoomLevel); ok { | |
| 112 | + | r0 = returnFunc(ctx, domain) | |
| 113 | + | } else { | |
| 114 | + | if ret.Get(0) != nil { | |
| 115 | + | r0 = ret.Get(0).(*entity.ZoomLevel) | |
| 116 | + | } | |
| 117 | + | } | |
| 118 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { | |
| 119 | + | r1 = returnFunc(ctx, domain) | |
| 120 | + | } else { | |
| 121 | + | r1 = ret.Error(1) | |
| 122 | + | } | |
| 123 | + | return r0, r1 | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | // MockZoomRepository_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' | |
| 127 | + | type MockZoomRepository_Get_Call struct { | |
| 128 | + | *mock.Call | |
| 129 | + | } | |
| 130 | + | ||
| 131 | + | // Get is a helper method to define mock.On call | |
| 132 | + | // - ctx context.Context | |
| 133 | + | // - domain string | |
| 134 | + | func (_e *MockZoomRepository_Expecter) Get(ctx interface{}, domain interface{}) *MockZoomRepository_Get_Call { | |
| 135 | + | return &MockZoomRepository_Get_Call{Call: _e.mock.On("Get", ctx, domain)} | |
| 136 | + | } | |
| 137 | + | ||
| 138 | + | func (_c *MockZoomRepository_Get_Call) Run(run func(ctx context.Context, domain string)) *MockZoomRepository_Get_Call { | |
| 139 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 140 | + | var arg0 context.Context | |
| 141 | + | if args[0] != nil { | |
| 142 | + | arg0 = args[0].(context.Context) | |
| 143 | + | } | |
| 144 | + | var arg1 string | |
| 145 | + | if args[1] != nil { | |
| 146 | + | arg1 = args[1].(string) | |
| 147 | + | } | |
| 148 | + | run( | |
| 149 | + | arg0, | |
| 150 | + | arg1, | |
| 151 | + | ) | |
| 152 | + | }) | |
| 153 | + | return _c | |
| 154 | + | } | |
| 155 | + | ||
| 156 | + | func (_c *MockZoomRepository_Get_Call) Return(zoomLevel *entity.ZoomLevel, err error) *MockZoomRepository_Get_Call { | |
| 157 | + | _c.Call.Return(zoomLevel, err) | |
| 158 | + | return _c | |
| 159 | + | } | |
| 160 | + | ||
| 161 | + | func (_c *MockZoomRepository_Get_Call) RunAndReturn(run func(ctx context.Context, domain string) (*entity.ZoomLevel, error)) *MockZoomRepository_Get_Call { | |
| 162 | + | _c.Call.Return(run) | |
| 163 | + | return _c | |
| 164 | + | } | |
| 165 | + | ||
| 166 | + | // GetAll provides a mock function for the type MockZoomRepository | |
| 167 | + | func (_mock *MockZoomRepository) GetAll(ctx context.Context) ([]*entity.ZoomLevel, error) { | |
| 168 | + | ret := _mock.Called(ctx) | |
| 169 | + | ||
| 170 | + | if len(ret) == 0 { | |
| 171 | + | panic("no return value specified for GetAll") | |
| 172 | + | } | |
| 173 | + | ||
| 174 | + | var r0 []*entity.ZoomLevel | |
| 175 | + | var r1 error | |
| 176 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.ZoomLevel, error)); ok { | |
| 177 | + | return returnFunc(ctx) | |
| 178 | + | } | |
| 179 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.ZoomLevel); ok { | |
| 180 | + | r0 = returnFunc(ctx) | |
| 181 | + | } else { | |
| 182 | + | if ret.Get(0) != nil { | |
| 183 | + | r0 = ret.Get(0).([]*entity.ZoomLevel) | |
| 184 | + | } | |
| 185 | + | } | |
| 186 | + | if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { | |
| 187 | + | r1 = returnFunc(ctx) | |
| 188 | + | } else { | |
| 189 | + | r1 = ret.Error(1) | |
| 190 | + | } | |
| 191 | + | return r0, r1 | |
| 192 | + | } | |
| 193 | + | ||
| 194 | + | // MockZoomRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' | |
| 195 | + | type MockZoomRepository_GetAll_Call struct { | |
| 196 | + | *mock.Call | |
| 197 | + | } | |
| 198 | + | ||
| 199 | + | // GetAll is a helper method to define mock.On call | |
| 200 | + | // - ctx context.Context | |
| 201 | + | func (_e *MockZoomRepository_Expecter) GetAll(ctx interface{}) *MockZoomRepository_GetAll_Call { | |
| 202 | + | return &MockZoomRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx)} | |
| 203 | + | } | |
| 204 | + | ||
| 205 | + | func (_c *MockZoomRepository_GetAll_Call) Run(run func(ctx context.Context)) *MockZoomRepository_GetAll_Call { | |
| 206 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 207 | + | var arg0 context.Context | |
| 208 | + | if args[0] != nil { | |
| 209 | + | arg0 = args[0].(context.Context) | |
| 210 | + | } | |
| 211 | + | run( | |
| 212 | + | arg0, | |
| 213 | + | ) | |
| 214 | + | }) | |
| 215 | + | return _c | |
| 216 | + | } | |
| 217 | + | ||
| 218 | + | func (_c *MockZoomRepository_GetAll_Call) Return(zoomLevels []*entity.ZoomLevel, err error) *MockZoomRepository_GetAll_Call { | |
| 219 | + | _c.Call.Return(zoomLevels, err) | |
| 220 | + | return _c | |
| 221 | + | } | |
| 222 | + | ||
| 223 | + | func (_c *MockZoomRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.ZoomLevel, error)) *MockZoomRepository_GetAll_Call { | |
| 224 | + | _c.Call.Return(run) | |
| 225 | + | return _c | |
| 226 | + | } | |
| 227 | + | ||
| 228 | + | // Set provides a mock function for the type MockZoomRepository | |
| 229 | + | func (_mock *MockZoomRepository) Set(ctx context.Context, level *entity.ZoomLevel) error { | |
| 230 | + | ret := _mock.Called(ctx, level) | |
| 231 | + | ||
| 232 | + | if len(ret) == 0 { | |
| 233 | + | panic("no return value specified for Set") | |
| 234 | + | } | |
| 235 | + | ||
| 236 | + | var r0 error | |
| 237 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.ZoomLevel) error); ok { | |
| 238 | + | r0 = returnFunc(ctx, level) | |
| 239 | + | } else { | |
| 240 | + | r0 = ret.Error(0) | |
| 241 | + | } | |
| 242 | + | return r0 | |
| 243 | + | } | |
| 244 | + | ||
| 245 | + | // MockZoomRepository_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set' | |
| 246 | + | type MockZoomRepository_Set_Call struct { | |
| 247 | + | *mock.Call | |
| 248 | + | } | |
| 249 | + | ||
| 250 | + | // Set is a helper method to define mock.On call | |
| 251 | + | // - ctx context.Context | |
| 252 | + | // - level *entity.ZoomLevel | |
| 253 | + | func (_e *MockZoomRepository_Expecter) Set(ctx interface{}, level interface{}) *MockZoomRepository_Set_Call { | |
| 254 | + | return &MockZoomRepository_Set_Call{Call: _e.mock.On("Set", ctx, level)} | |
| 255 | + | } | |
| 256 | + | ||
| 257 | + | func (_c *MockZoomRepository_Set_Call) Run(run func(ctx context.Context, level *entity.ZoomLevel)) *MockZoomRepository_Set_Call { | |
| 258 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 259 | + | var arg0 context.Context | |
| 260 | + | if args[0] != nil { | |
| 261 | + | arg0 = args[0].(context.Context) | |
| 262 | + | } | |
| 263 | + | var arg1 *entity.ZoomLevel | |
| 264 | + | if args[1] != nil { | |
| 265 | + | arg1 = args[1].(*entity.ZoomLevel) | |
| 266 | + | } | |
| 267 | + | run( | |
| 268 | + | arg0, | |
| 269 | + | arg1, | |
| 270 | + | ) | |
| 271 | + | }) | |
| 272 | + | return _c | |
| 273 | + | } | |
| 274 | + | ||
| 275 | + | func (_c *MockZoomRepository_Set_Call) Return(err error) *MockZoomRepository_Set_Call { | |
| 276 | + | _c.Call.Return(err) | |
| 277 | + | return _c | |
| 278 | + | } | |
| 279 | + | ||
| 280 | + | func (_c *MockZoomRepository_Set_Call) RunAndReturn(run func(ctx context.Context, level *entity.ZoomLevel) error) *MockZoomRepository_Set_Call { | |
| 281 | + | _c.Call.Return(run) | |
| 282 | + | return _c | |
| 283 | + | } | |
| @@ -0,0 +1,283 @@ | |||||
| 1 | + | // Code generated by mockery; DO NOT EDIT. | |||
| 2 | + | // github.com/vektra/mockery | |||
| 3 | + | // template: testify | |||
| 4 | + | ||||
| 5 | + | package mocks | |||
| 6 | + | ||||
| 7 | + | import ( | |||
| 8 | + | "context" | |||
| 9 | + | ||||
| 10 | + | "github.com/bnema/dumber/internal/domain/entity" | |||
| 11 | + | mock "github.com/stretchr/testify/mock" | |||
| 12 | + | ) | |||
| 13 | + | ||||
| 14 | + | // NewMockZoomRepository creates a new instance of MockZoomRepository. 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. | |||
| 16 | + | func NewMockZoomRepository(t interface { | |||
| 17 | + | mock.TestingT | |||
| 18 | + | Cleanup(func()) | |||
| 19 | + | }) *MockZoomRepository { | |||
| 20 | + | mock := &MockZoomRepository{} | |||
| 21 | + | mock.Mock.Test(t) | |||
| 22 | + | ||||
| 23 | + | t.Cleanup(func() { mock.AssertExpectations(t) }) | |||
| 24 | + | ||||
| 25 | + | return mock | |||
| 26 | + | } | |||
| 27 | + | ||||
| 28 | + | // MockZoomRepository is an autogenerated mock type for the ZoomRepository type | |||
| 29 | + | type MockZoomRepository struct { | |||
| 30 | + | mock.Mock | |||
| 31 | + | } | |||
| 32 | + | ||||
| 33 | + | type MockZoomRepository_Expecter struct { | |||
| 34 | + | mock *mock.Mock | |||
| 35 | + | } | |||
| 36 | + | ||||
| 37 | + | func (_m *MockZoomRepository) EXPECT() *MockZoomRepository_Expecter { | |||
| 38 | + | return &MockZoomRepository_Expecter{mock: &_m.Mock} | |||
| 39 | + | } | |||
| 40 | + | ||||
| 41 | + | // Delete provides a mock function for the type MockZoomRepository | |||
| 42 | + | func (_mock *MockZoomRepository) Delete(ctx context.Context, domain string) error { | |||
| 43 | + | ret := _mock.Called(ctx, domain) | |||
| 44 | + | ||||
| 45 | + | if len(ret) == 0 { | |||
| 46 | + | panic("no return value specified for Delete") | |||
| 47 | + | } | |||
| 48 | + | ||||
| 49 | + | var r0 error | |||
| 50 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { | |||
| 51 | + | r0 = returnFunc(ctx, domain) | |||
| 52 | + | } else { | |||
| 53 | + | r0 = ret.Error(0) | |||
| 54 | + | } | |||
| 55 | + | return r0 | |||
| 56 | + | } | |||
| 57 | + | ||||
| 58 | + | // MockZoomRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' | |||
| 59 | + | type MockZoomRepository_Delete_Call struct { | |||
| 60 | + | *mock.Call | |||
| 61 | + | } | |||
| 62 | + | ||||
| 63 | + | // Delete is a helper method to define mock.On call | |||
| 64 | + | // - ctx context.Context | |||
| 65 | + | // - domain string | |||
| 66 | + | func (_e *MockZoomRepository_Expecter) Delete(ctx interface{}, domain interface{}) *MockZoomRepository_Delete_Call { | |||
| 67 | + | return &MockZoomRepository_Delete_Call{Call: _e.mock.On("Delete", ctx, domain)} | |||
| 68 | + | } | |||
| 69 | + | ||||
| 70 | + | func (_c *MockZoomRepository_Delete_Call) Run(run func(ctx context.Context, domain string)) *MockZoomRepository_Delete_Call { | |||
| 71 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 72 | + | var arg0 context.Context | |||
| 73 | + | if args[0] != nil { | |||
| 74 | + | arg0 = args[0].(context.Context) | |||
| 75 | + | } | |||
| 76 | + | var arg1 string | |||
| 77 | + | if args[1] != nil { | |||
| 78 | + | arg1 = args[1].(string) | |||
| 79 | + | } | |||
| 80 | + | run( | |||
| 81 | + | arg0, | |||
| 82 | + | arg1, | |||
| 83 | + | ) | |||
| 84 | + | }) | |||
| 85 | + | return _c | |||
| 86 | + | } | |||
| 87 | + | ||||
| 88 | + | func (_c *MockZoomRepository_Delete_Call) Return(err error) *MockZoomRepository_Delete_Call { | |||
| 89 | + | _c.Call.Return(err) | |||
| 90 | + | return _c | |||
| 91 | + | } | |||
| 92 | + | ||||
| 93 | + | func (_c *MockZoomRepository_Delete_Call) RunAndReturn(run func(ctx context.Context, domain string) error) *MockZoomRepository_Delete_Call { | |||
| 94 | + | _c.Call.Return(run) | |||
| 95 | + | return _c | |||
| 96 | + | } | |||
| 97 | + | ||||
| 98 | + | // Get provides a mock function for the type MockZoomRepository | |||
| 99 | + | func (_mock *MockZoomRepository) Get(ctx context.Context, domain string) (*entity.ZoomLevel, error) { | |||
| 100 | + | ret := _mock.Called(ctx, domain) | |||
| 101 | + | ||||
| 102 | + | if len(ret) == 0 { | |||
| 103 | + | panic("no return value specified for Get") | |||
| 104 | + | } | |||
| 105 | + | ||||
| 106 | + | var r0 *entity.ZoomLevel | |||
| 107 | + | var r1 error | |||
| 108 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*entity.ZoomLevel, error)); ok { | |||
| 109 | + | return returnFunc(ctx, domain) | |||
| 110 | + | } | |||
| 111 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, string) *entity.ZoomLevel); ok { | |||
| 112 | + | r0 = returnFunc(ctx, domain) | |||
| 113 | + | } else { | |||
| 114 | + | if ret.Get(0) != nil { | |||
| 115 | + | r0 = ret.Get(0).(*entity.ZoomLevel) | |||
| 116 | + | } | |||
| 117 | + | } | |||
| 118 | + | if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { | |||
| 119 | + | r1 = returnFunc(ctx, domain) | |||
| 120 | + | } else { | |||
| 121 | + | r1 = ret.Error(1) | |||
| 122 | + | } | |||
| 123 | + | return r0, r1 | |||
| 124 | + | } | |||
| 125 | + | ||||
| 126 | + | // MockZoomRepository_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' | |||
| 127 | + | type MockZoomRepository_Get_Call struct { | |||
| 128 | + | *mock.Call | |||
| 129 | + | } | |||
| 130 | + | ||||
| 131 | + | // Get is a helper method to define mock.On call | |||
| 132 | + | // - ctx context.Context | |||
| 133 | + | // - domain string | |||
| 134 | + | func (_e *MockZoomRepository_Expecter) Get(ctx interface{}, domain interface{}) *MockZoomRepository_Get_Call { | |||
| 135 | + | return &MockZoomRepository_Get_Call{Call: _e.mock.On("Get", ctx, domain)} | |||
| 136 | + | } | |||
| 137 | + | ||||
| 138 | + | func (_c *MockZoomRepository_Get_Call) Run(run func(ctx context.Context, domain string)) *MockZoomRepository_Get_Call { | |||
| 139 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 140 | + | var arg0 context.Context | |||
| 141 | + | if args[0] != nil { | |||
| 142 | + | arg0 = args[0].(context.Context) | |||
| 143 | + | } | |||
| 144 | + | var arg1 string | |||
| 145 | + | if args[1] != nil { | |||
| 146 | + | arg1 = args[1].(string) | |||
| 147 | + | } | |||
| 148 | + | run( | |||
| 149 | + | arg0, | |||
| 150 | + | arg1, | |||
| 151 | + | ) | |||
| 152 | + | }) | |||
| 153 | + | return _c | |||
| 154 | + | } | |||
| 155 | + | ||||
| 156 | + | func (_c *MockZoomRepository_Get_Call) Return(zoomLevel *entity.ZoomLevel, err error) *MockZoomRepository_Get_Call { | |||
| 157 | + | _c.Call.Return(zoomLevel, err) | |||
| 158 | + | return _c | |||
| 159 | + | } | |||
| 160 | + | ||||
| 161 | + | func (_c *MockZoomRepository_Get_Call) RunAndReturn(run func(ctx context.Context, domain string) (*entity.ZoomLevel, error)) *MockZoomRepository_Get_Call { | |||
| 162 | + | _c.Call.Return(run) | |||
| 163 | + | return _c | |||
| 164 | + | } | |||
| 165 | + | ||||
| 166 | + | // GetAll provides a mock function for the type MockZoomRepository | |||
| 167 | + | func (_mock *MockZoomRepository) GetAll(ctx context.Context) ([]*entity.ZoomLevel, error) { | |||
| 168 | + | ret := _mock.Called(ctx) | |||
| 169 | + | ||||
| 170 | + | if len(ret) == 0 { | |||
| 171 | + | panic("no return value specified for GetAll") | |||
| 172 | + | } | |||
| 173 | + | ||||
| 174 | + | var r0 []*entity.ZoomLevel | |||
| 175 | + | var r1 error | |||
| 176 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) ([]*entity.ZoomLevel, error)); ok { | |||
| 177 | + | return returnFunc(ctx) | |||
| 178 | + | } | |||
| 179 | + | if returnFunc, ok := ret.Get(0).(func(context.Context) []*entity.ZoomLevel); ok { | |||
| 180 | + | r0 = returnFunc(ctx) | |||
| 181 | + | } else { | |||
| 182 | + | if ret.Get(0) != nil { | |||
| 183 | + | r0 = ret.Get(0).([]*entity.ZoomLevel) | |||
| 184 | + | } | |||
| 185 | + | } | |||
| 186 | + | if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { | |||
| 187 | + | r1 = returnFunc(ctx) | |||
| 188 | + | } else { | |||
| 189 | + | r1 = ret.Error(1) | |||
| 190 | + | } | |||
| 191 | + | return r0, r1 | |||
| 192 | + | } | |||
| 193 | + | ||||
| 194 | + | // MockZoomRepository_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' | |||
| 195 | + | type MockZoomRepository_GetAll_Call struct { | |||
| 196 | + | *mock.Call | |||
| 197 | + | } | |||
| 198 | + | ||||
| 199 | + | // GetAll is a helper method to define mock.On call | |||
| 200 | + | // - ctx context.Context | |||
| 201 | + | func (_e *MockZoomRepository_Expecter) GetAll(ctx interface{}) *MockZoomRepository_GetAll_Call { | |||
| 202 | + | return &MockZoomRepository_GetAll_Call{Call: _e.mock.On("GetAll", ctx)} | |||
| 203 | + | } | |||
| 204 | + | ||||
| 205 | + | func (_c *MockZoomRepository_GetAll_Call) Run(run func(ctx context.Context)) *MockZoomRepository_GetAll_Call { | |||
| 206 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 207 | + | var arg0 context.Context | |||
| 208 | + | if args[0] != nil { | |||
| 209 | + | arg0 = args[0].(context.Context) | |||
| 210 | + | } | |||
| 211 | + | run( | |||
| 212 | + | arg0, | |||
| 213 | + | ) | |||
| 214 | + | }) | |||
| 215 | + | return _c | |||
| 216 | + | } | |||
| 217 | + | ||||
| 218 | + | func (_c *MockZoomRepository_GetAll_Call) Return(zoomLevels []*entity.ZoomLevel, err error) *MockZoomRepository_GetAll_Call { | |||
| 219 | + | _c.Call.Return(zoomLevels, err) | |||
| 220 | + | return _c | |||
| 221 | + | } | |||
| 222 | + | ||||
| 223 | + | func (_c *MockZoomRepository_GetAll_Call) RunAndReturn(run func(ctx context.Context) ([]*entity.ZoomLevel, error)) *MockZoomRepository_GetAll_Call { | |||
| 224 | + | _c.Call.Return(run) | |||
| 225 | + | return _c | |||
| 226 | + | } | |||
| 227 | + | ||||
| 228 | + | // Set provides a mock function for the type MockZoomRepository | |||
| 229 | + | func (_mock *MockZoomRepository) Set(ctx context.Context, level *entity.ZoomLevel) error { | |||
| 230 | + | ret := _mock.Called(ctx, level) | |||
| 231 | + | ||||
| 232 | + | if len(ret) == 0 { | |||
| 233 | + | panic("no return value specified for Set") | |||
| 234 | + | } | |||
| 235 | + | ||||
| 236 | + | var r0 error | |||
| 237 | + | if returnFunc, ok := ret.Get(0).(func(context.Context, *entity.ZoomLevel) error); ok { | |||
| 238 | + | r0 = returnFunc(ctx, level) | |||
| 239 | + | } else { | |||
| 240 | + | r0 = ret.Error(0) | |||
| 241 | + | } | |||
| 242 | + | return r0 | |||
| 243 | + | } | |||
| 244 | + | ||||
| 245 | + | // MockZoomRepository_Set_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Set' | |||
| 246 | + | type MockZoomRepository_Set_Call struct { | |||
| 247 | + | *mock.Call | |||
| 248 | + | } | |||
| 249 | + | ||||
| 250 | + | // Set is a helper method to define mock.On call | |||
| 251 | + | // - ctx context.Context | |||
| 252 | + | // - level *entity.ZoomLevel | |||
| 253 | + | func (_e *MockZoomRepository_Expecter) Set(ctx interface{}, level interface{}) *MockZoomRepository_Set_Call { | |||
| 254 | + | return &MockZoomRepository_Set_Call{Call: _e.mock.On("Set", ctx, level)} | |||
| 255 | + | } | |||
| 256 | + | ||||
| 257 | + | func (_c *MockZoomRepository_Set_Call) Run(run func(ctx context.Context, level *entity.ZoomLevel)) *MockZoomRepository_Set_Call { | |||
| 258 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 259 | + | var arg0 context.Context | |||
| 260 | + | if args[0] != nil { | |||
| 261 | + | arg0 = args[0].(context.Context) | |||
| 262 | + | } | |||
| 263 | + | var arg1 *entity.ZoomLevel | |||
| 264 | + | if args[1] != nil { | |||
| 265 | + | arg1 = args[1].(*entity.ZoomLevel) | |||
| 266 | + | } | |||
| 267 | + | run( | |||
| 268 | + | arg0, | |||
| 269 | + | arg1, | |||
| 270 | + | ) | |||
| 271 | + | }) | |||
| 272 | + | return _c | |||
| 273 | + | } | |||
| 274 | + | ||||
| 275 | + | func (_c *MockZoomRepository_Set_Call) Return(err error) *MockZoomRepository_Set_Call { | |||
| 276 | + | _c.Call.Return(err) | |||
| 277 | + | return _c | |||
| 278 | + | } | |||
| 279 | + | ||||
| 280 | + | func (_c *MockZoomRepository_Set_Call) RunAndReturn(run func(ctx context.Context, level *entity.ZoomLevel) error) *MockZoomRepository_Set_Call { | |||
| 281 | + | _c.Call.Return(run) | |||
| 282 | + | return _c | |||
| 283 | + | } | |||