flamingo.me/flamingo-commerce/v3@v3.11.0/cart/application/mocks/receiver.go (about) 1 // Code generated by mockery v2.42.3. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 context "context" 7 8 cart "flamingo.me/flamingo-commerce/v3/cart/domain/cart" 9 10 mock "github.com/stretchr/testify/mock" 11 12 web "flamingo.me/flamingo/v3/framework/web" 13 ) 14 15 // CartReceiver is an autogenerated mock type for the Receiver type 16 type CartReceiver struct { 17 mock.Mock 18 } 19 20 type CartReceiver_Expecter struct { 21 mock *mock.Mock 22 } 23 24 func (_m *CartReceiver) EXPECT() *CartReceiver_Expecter { 25 return &CartReceiver_Expecter{mock: &_m.Mock} 26 } 27 28 // GetCart provides a mock function with given fields: ctx, session 29 func (_m *CartReceiver) GetCart(ctx context.Context, session *web.Session) (*cart.Cart, cart.ModifyBehaviour, error) { 30 ret := _m.Called(ctx, session) 31 32 if len(ret) == 0 { 33 panic("no return value specified for GetCart") 34 } 35 36 var r0 *cart.Cart 37 var r1 cart.ModifyBehaviour 38 var r2 error 39 if rf, ok := ret.Get(0).(func(context.Context, *web.Session) (*cart.Cart, cart.ModifyBehaviour, error)); ok { 40 return rf(ctx, session) 41 } 42 if rf, ok := ret.Get(0).(func(context.Context, *web.Session) *cart.Cart); ok { 43 r0 = rf(ctx, session) 44 } else { 45 if ret.Get(0) != nil { 46 r0 = ret.Get(0).(*cart.Cart) 47 } 48 } 49 50 if rf, ok := ret.Get(1).(func(context.Context, *web.Session) cart.ModifyBehaviour); ok { 51 r1 = rf(ctx, session) 52 } else { 53 if ret.Get(1) != nil { 54 r1 = ret.Get(1).(cart.ModifyBehaviour) 55 } 56 } 57 58 if rf, ok := ret.Get(2).(func(context.Context, *web.Session) error); ok { 59 r2 = rf(ctx, session) 60 } else { 61 r2 = ret.Error(2) 62 } 63 64 return r0, r1, r2 65 } 66 67 // CartReceiver_GetCart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCart' 68 type CartReceiver_GetCart_Call struct { 69 *mock.Call 70 } 71 72 // GetCart is a helper method to define mock.On call 73 // - ctx context.Context 74 // - session *web.Session 75 func (_e *CartReceiver_Expecter) GetCart(ctx interface{}, session interface{}) *CartReceiver_GetCart_Call { 76 return &CartReceiver_GetCart_Call{Call: _e.mock.On("GetCart", ctx, session)} 77 } 78 79 func (_c *CartReceiver_GetCart_Call) Run(run func(ctx context.Context, session *web.Session)) *CartReceiver_GetCart_Call { 80 _c.Call.Run(func(args mock.Arguments) { 81 run(args[0].(context.Context), args[1].(*web.Session)) 82 }) 83 return _c 84 } 85 86 func (_c *CartReceiver_GetCart_Call) Return(_a0 *cart.Cart, _a1 cart.ModifyBehaviour, _a2 error) *CartReceiver_GetCart_Call { 87 _c.Call.Return(_a0, _a1, _a2) 88 return _c 89 } 90 91 func (_c *CartReceiver_GetCart_Call) RunAndReturn(run func(context.Context, *web.Session) (*cart.Cart, cart.ModifyBehaviour, error)) *CartReceiver_GetCart_Call { 92 _c.Call.Return(run) 93 return _c 94 } 95 96 // GetCartWithoutCache provides a mock function with given fields: ctx, session 97 func (_m *CartReceiver) GetCartWithoutCache(ctx context.Context, session *web.Session) (*cart.Cart, error) { 98 ret := _m.Called(ctx, session) 99 100 if len(ret) == 0 { 101 panic("no return value specified for GetCartWithoutCache") 102 } 103 104 var r0 *cart.Cart 105 var r1 error 106 if rf, ok := ret.Get(0).(func(context.Context, *web.Session) (*cart.Cart, error)); ok { 107 return rf(ctx, session) 108 } 109 if rf, ok := ret.Get(0).(func(context.Context, *web.Session) *cart.Cart); ok { 110 r0 = rf(ctx, session) 111 } else { 112 if ret.Get(0) != nil { 113 r0 = ret.Get(0).(*cart.Cart) 114 } 115 } 116 117 if rf, ok := ret.Get(1).(func(context.Context, *web.Session) error); ok { 118 r1 = rf(ctx, session) 119 } else { 120 r1 = ret.Error(1) 121 } 122 123 return r0, r1 124 } 125 126 // CartReceiver_GetCartWithoutCache_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCartWithoutCache' 127 type CartReceiver_GetCartWithoutCache_Call struct { 128 *mock.Call 129 } 130 131 // GetCartWithoutCache is a helper method to define mock.On call 132 // - ctx context.Context 133 // - session *web.Session 134 func (_e *CartReceiver_Expecter) GetCartWithoutCache(ctx interface{}, session interface{}) *CartReceiver_GetCartWithoutCache_Call { 135 return &CartReceiver_GetCartWithoutCache_Call{Call: _e.mock.On("GetCartWithoutCache", ctx, session)} 136 } 137 138 func (_c *CartReceiver_GetCartWithoutCache_Call) Run(run func(ctx context.Context, session *web.Session)) *CartReceiver_GetCartWithoutCache_Call { 139 _c.Call.Run(func(args mock.Arguments) { 140 run(args[0].(context.Context), args[1].(*web.Session)) 141 }) 142 return _c 143 } 144 145 func (_c *CartReceiver_GetCartWithoutCache_Call) Return(_a0 *cart.Cart, _a1 error) *CartReceiver_GetCartWithoutCache_Call { 146 _c.Call.Return(_a0, _a1) 147 return _c 148 } 149 150 func (_c *CartReceiver_GetCartWithoutCache_Call) RunAndReturn(run func(context.Context, *web.Session) (*cart.Cart, error)) *CartReceiver_GetCartWithoutCache_Call { 151 _c.Call.Return(run) 152 return _c 153 } 154 155 // ModifyBehaviour provides a mock function with given fields: ctx 156 func (_m *CartReceiver) ModifyBehaviour(ctx context.Context) (cart.ModifyBehaviour, error) { 157 ret := _m.Called(ctx) 158 159 if len(ret) == 0 { 160 panic("no return value specified for ModifyBehaviour") 161 } 162 163 var r0 cart.ModifyBehaviour 164 var r1 error 165 if rf, ok := ret.Get(0).(func(context.Context) (cart.ModifyBehaviour, error)); ok { 166 return rf(ctx) 167 } 168 if rf, ok := ret.Get(0).(func(context.Context) cart.ModifyBehaviour); ok { 169 r0 = rf(ctx) 170 } else { 171 if ret.Get(0) != nil { 172 r0 = ret.Get(0).(cart.ModifyBehaviour) 173 } 174 } 175 176 if rf, ok := ret.Get(1).(func(context.Context) error); ok { 177 r1 = rf(ctx) 178 } else { 179 r1 = ret.Error(1) 180 } 181 182 return r0, r1 183 } 184 185 // CartReceiver_ModifyBehaviour_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ModifyBehaviour' 186 type CartReceiver_ModifyBehaviour_Call struct { 187 *mock.Call 188 } 189 190 // ModifyBehaviour is a helper method to define mock.On call 191 // - ctx context.Context 192 func (_e *CartReceiver_Expecter) ModifyBehaviour(ctx interface{}) *CartReceiver_ModifyBehaviour_Call { 193 return &CartReceiver_ModifyBehaviour_Call{Call: _e.mock.On("ModifyBehaviour", ctx)} 194 } 195 196 func (_c *CartReceiver_ModifyBehaviour_Call) Run(run func(ctx context.Context)) *CartReceiver_ModifyBehaviour_Call { 197 _c.Call.Run(func(args mock.Arguments) { 198 run(args[0].(context.Context)) 199 }) 200 return _c 201 } 202 203 func (_c *CartReceiver_ModifyBehaviour_Call) Return(_a0 cart.ModifyBehaviour, _a1 error) *CartReceiver_ModifyBehaviour_Call { 204 _c.Call.Return(_a0, _a1) 205 return _c 206 } 207 208 func (_c *CartReceiver_ModifyBehaviour_Call) RunAndReturn(run func(context.Context) (cart.ModifyBehaviour, error)) *CartReceiver_ModifyBehaviour_Call { 209 _c.Call.Return(run) 210 return _c 211 } 212 213 // ShouldHaveCart provides a mock function with given fields: ctx, session 214 func (_m *CartReceiver) ShouldHaveCart(ctx context.Context, session *web.Session) bool { 215 ret := _m.Called(ctx, session) 216 217 if len(ret) == 0 { 218 panic("no return value specified for ShouldHaveCart") 219 } 220 221 var r0 bool 222 if rf, ok := ret.Get(0).(func(context.Context, *web.Session) bool); ok { 223 r0 = rf(ctx, session) 224 } else { 225 r0 = ret.Get(0).(bool) 226 } 227 228 return r0 229 } 230 231 // CartReceiver_ShouldHaveCart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ShouldHaveCart' 232 type CartReceiver_ShouldHaveCart_Call struct { 233 *mock.Call 234 } 235 236 // ShouldHaveCart is a helper method to define mock.On call 237 // - ctx context.Context 238 // - session *web.Session 239 func (_e *CartReceiver_Expecter) ShouldHaveCart(ctx interface{}, session interface{}) *CartReceiver_ShouldHaveCart_Call { 240 return &CartReceiver_ShouldHaveCart_Call{Call: _e.mock.On("ShouldHaveCart", ctx, session)} 241 } 242 243 func (_c *CartReceiver_ShouldHaveCart_Call) Run(run func(ctx context.Context, session *web.Session)) *CartReceiver_ShouldHaveCart_Call { 244 _c.Call.Run(func(args mock.Arguments) { 245 run(args[0].(context.Context), args[1].(*web.Session)) 246 }) 247 return _c 248 } 249 250 func (_c *CartReceiver_ShouldHaveCart_Call) Return(_a0 bool) *CartReceiver_ShouldHaveCart_Call { 251 _c.Call.Return(_a0) 252 return _c 253 } 254 255 func (_c *CartReceiver_ShouldHaveCart_Call) RunAndReturn(run func(context.Context, *web.Session) bool) *CartReceiver_ShouldHaveCart_Call { 256 _c.Call.Return(run) 257 return _c 258 } 259 260 // ShouldHaveGuestCart provides a mock function with given fields: session 261 func (_m *CartReceiver) ShouldHaveGuestCart(session *web.Session) bool { 262 ret := _m.Called(session) 263 264 if len(ret) == 0 { 265 panic("no return value specified for ShouldHaveGuestCart") 266 } 267 268 var r0 bool 269 if rf, ok := ret.Get(0).(func(*web.Session) bool); ok { 270 r0 = rf(session) 271 } else { 272 r0 = ret.Get(0).(bool) 273 } 274 275 return r0 276 } 277 278 // CartReceiver_ShouldHaveGuestCart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ShouldHaveGuestCart' 279 type CartReceiver_ShouldHaveGuestCart_Call struct { 280 *mock.Call 281 } 282 283 // ShouldHaveGuestCart is a helper method to define mock.On call 284 // - session *web.Session 285 func (_e *CartReceiver_Expecter) ShouldHaveGuestCart(session interface{}) *CartReceiver_ShouldHaveGuestCart_Call { 286 return &CartReceiver_ShouldHaveGuestCart_Call{Call: _e.mock.On("ShouldHaveGuestCart", session)} 287 } 288 289 func (_c *CartReceiver_ShouldHaveGuestCart_Call) Run(run func(session *web.Session)) *CartReceiver_ShouldHaveGuestCart_Call { 290 _c.Call.Run(func(args mock.Arguments) { 291 run(args[0].(*web.Session)) 292 }) 293 return _c 294 } 295 296 func (_c *CartReceiver_ShouldHaveGuestCart_Call) Return(_a0 bool) *CartReceiver_ShouldHaveGuestCart_Call { 297 _c.Call.Return(_a0) 298 return _c 299 } 300 301 func (_c *CartReceiver_ShouldHaveGuestCart_Call) RunAndReturn(run func(*web.Session) bool) *CartReceiver_ShouldHaveGuestCart_Call { 302 _c.Call.Return(run) 303 return _c 304 } 305 306 // ViewCart provides a mock function with given fields: ctx, session 307 func (_m *CartReceiver) ViewCart(ctx context.Context, session *web.Session) (*cart.Cart, error) { 308 ret := _m.Called(ctx, session) 309 310 if len(ret) == 0 { 311 panic("no return value specified for ViewCart") 312 } 313 314 var r0 *cart.Cart 315 var r1 error 316 if rf, ok := ret.Get(0).(func(context.Context, *web.Session) (*cart.Cart, error)); ok { 317 return rf(ctx, session) 318 } 319 if rf, ok := ret.Get(0).(func(context.Context, *web.Session) *cart.Cart); ok { 320 r0 = rf(ctx, session) 321 } else { 322 if ret.Get(0) != nil { 323 r0 = ret.Get(0).(*cart.Cart) 324 } 325 } 326 327 if rf, ok := ret.Get(1).(func(context.Context, *web.Session) error); ok { 328 r1 = rf(ctx, session) 329 } else { 330 r1 = ret.Error(1) 331 } 332 333 return r0, r1 334 } 335 336 // CartReceiver_ViewCart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ViewCart' 337 type CartReceiver_ViewCart_Call struct { 338 *mock.Call 339 } 340 341 // ViewCart is a helper method to define mock.On call 342 // - ctx context.Context 343 // - session *web.Session 344 func (_e *CartReceiver_Expecter) ViewCart(ctx interface{}, session interface{}) *CartReceiver_ViewCart_Call { 345 return &CartReceiver_ViewCart_Call{Call: _e.mock.On("ViewCart", ctx, session)} 346 } 347 348 func (_c *CartReceiver_ViewCart_Call) Run(run func(ctx context.Context, session *web.Session)) *CartReceiver_ViewCart_Call { 349 _c.Call.Run(func(args mock.Arguments) { 350 run(args[0].(context.Context), args[1].(*web.Session)) 351 }) 352 return _c 353 } 354 355 func (_c *CartReceiver_ViewCart_Call) Return(_a0 *cart.Cart, _a1 error) *CartReceiver_ViewCart_Call { 356 _c.Call.Return(_a0, _a1) 357 return _c 358 } 359 360 func (_c *CartReceiver_ViewCart_Call) RunAndReturn(run func(context.Context, *web.Session) (*cart.Cart, error)) *CartReceiver_ViewCart_Call { 361 _c.Call.Return(run) 362 return _c 363 } 364 365 // ViewGuestCart provides a mock function with given fields: ctx, session 366 func (_m *CartReceiver) ViewGuestCart(ctx context.Context, session *web.Session) (*cart.Cart, error) { 367 ret := _m.Called(ctx, session) 368 369 if len(ret) == 0 { 370 panic("no return value specified for ViewGuestCart") 371 } 372 373 var r0 *cart.Cart 374 var r1 error 375 if rf, ok := ret.Get(0).(func(context.Context, *web.Session) (*cart.Cart, error)); ok { 376 return rf(ctx, session) 377 } 378 if rf, ok := ret.Get(0).(func(context.Context, *web.Session) *cart.Cart); ok { 379 r0 = rf(ctx, session) 380 } else { 381 if ret.Get(0) != nil { 382 r0 = ret.Get(0).(*cart.Cart) 383 } 384 } 385 386 if rf, ok := ret.Get(1).(func(context.Context, *web.Session) error); ok { 387 r1 = rf(ctx, session) 388 } else { 389 r1 = ret.Error(1) 390 } 391 392 return r0, r1 393 } 394 395 // CartReceiver_ViewGuestCart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ViewGuestCart' 396 type CartReceiver_ViewGuestCart_Call struct { 397 *mock.Call 398 } 399 400 // ViewGuestCart is a helper method to define mock.On call 401 // - ctx context.Context 402 // - session *web.Session 403 func (_e *CartReceiver_Expecter) ViewGuestCart(ctx interface{}, session interface{}) *CartReceiver_ViewGuestCart_Call { 404 return &CartReceiver_ViewGuestCart_Call{Call: _e.mock.On("ViewGuestCart", ctx, session)} 405 } 406 407 func (_c *CartReceiver_ViewGuestCart_Call) Run(run func(ctx context.Context, session *web.Session)) *CartReceiver_ViewGuestCart_Call { 408 _c.Call.Run(func(args mock.Arguments) { 409 run(args[0].(context.Context), args[1].(*web.Session)) 410 }) 411 return _c 412 } 413 414 func (_c *CartReceiver_ViewGuestCart_Call) Return(_a0 *cart.Cart, _a1 error) *CartReceiver_ViewGuestCart_Call { 415 _c.Call.Return(_a0, _a1) 416 return _c 417 } 418 419 func (_c *CartReceiver_ViewGuestCart_Call) RunAndReturn(run func(context.Context, *web.Session) (*cart.Cart, error)) *CartReceiver_ViewGuestCart_Call { 420 _c.Call.Return(run) 421 return _c 422 } 423 424 // NewCartReceiver creates a new instance of CartReceiver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 425 // The first argument is typically a *testing.T value. 426 func NewCartReceiver(t interface { 427 mock.TestingT 428 Cleanup(func()) 429 }) *CartReceiver { 430 mock := &CartReceiver{} 431 mock.Mock.Test(t) 432 433 t.Cleanup(func() { mock.AssertExpectations(t) }) 434 435 return mock 436 }