flamingo.me/flamingo-commerce/v3@v3.11.0/cart/application/mocks/cart_cache.go (about) 1 // Code generated by mockery v2.42.3. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 application "flamingo.me/flamingo-commerce/v3/cart/application" 7 cart "flamingo.me/flamingo-commerce/v3/cart/domain/cart" 8 9 context "context" 10 11 mock "github.com/stretchr/testify/mock" 12 13 web "flamingo.me/flamingo/v3/framework/web" 14 ) 15 16 // CartCache is an autogenerated mock type for the CartCache type 17 type CartCache struct { 18 mock.Mock 19 } 20 21 type CartCache_Expecter struct { 22 mock *mock.Mock 23 } 24 25 func (_m *CartCache) EXPECT() *CartCache_Expecter { 26 return &CartCache_Expecter{mock: &_m.Mock} 27 } 28 29 // BuildIdentifier provides a mock function with given fields: _a0, _a1 30 func (_m *CartCache) BuildIdentifier(_a0 context.Context, _a1 *web.Session) (application.CartCacheIdentifier, error) { 31 ret := _m.Called(_a0, _a1) 32 33 if len(ret) == 0 { 34 panic("no return value specified for BuildIdentifier") 35 } 36 37 var r0 application.CartCacheIdentifier 38 var r1 error 39 if rf, ok := ret.Get(0).(func(context.Context, *web.Session) (application.CartCacheIdentifier, error)); ok { 40 return rf(_a0, _a1) 41 } 42 if rf, ok := ret.Get(0).(func(context.Context, *web.Session) application.CartCacheIdentifier); ok { 43 r0 = rf(_a0, _a1) 44 } else { 45 r0 = ret.Get(0).(application.CartCacheIdentifier) 46 } 47 48 if rf, ok := ret.Get(1).(func(context.Context, *web.Session) error); ok { 49 r1 = rf(_a0, _a1) 50 } else { 51 r1 = ret.Error(1) 52 } 53 54 return r0, r1 55 } 56 57 // CartCache_BuildIdentifier_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BuildIdentifier' 58 type CartCache_BuildIdentifier_Call struct { 59 *mock.Call 60 } 61 62 // BuildIdentifier is a helper method to define mock.On call 63 // - _a0 context.Context 64 // - _a1 *web.Session 65 func (_e *CartCache_Expecter) BuildIdentifier(_a0 interface{}, _a1 interface{}) *CartCache_BuildIdentifier_Call { 66 return &CartCache_BuildIdentifier_Call{Call: _e.mock.On("BuildIdentifier", _a0, _a1)} 67 } 68 69 func (_c *CartCache_BuildIdentifier_Call) Run(run func(_a0 context.Context, _a1 *web.Session)) *CartCache_BuildIdentifier_Call { 70 _c.Call.Run(func(args mock.Arguments) { 71 run(args[0].(context.Context), args[1].(*web.Session)) 72 }) 73 return _c 74 } 75 76 func (_c *CartCache_BuildIdentifier_Call) Return(_a0 application.CartCacheIdentifier, _a1 error) *CartCache_BuildIdentifier_Call { 77 _c.Call.Return(_a0, _a1) 78 return _c 79 } 80 81 func (_c *CartCache_BuildIdentifier_Call) RunAndReturn(run func(context.Context, *web.Session) (application.CartCacheIdentifier, error)) *CartCache_BuildIdentifier_Call { 82 _c.Call.Return(run) 83 return _c 84 } 85 86 // CacheCart provides a mock function with given fields: _a0, _a1, _a2, _a3 87 func (_m *CartCache) CacheCart(_a0 context.Context, _a1 *web.Session, _a2 application.CartCacheIdentifier, _a3 *cart.Cart) error { 88 ret := _m.Called(_a0, _a1, _a2, _a3) 89 90 if len(ret) == 0 { 91 panic("no return value specified for CacheCart") 92 } 93 94 var r0 error 95 if rf, ok := ret.Get(0).(func(context.Context, *web.Session, application.CartCacheIdentifier, *cart.Cart) error); ok { 96 r0 = rf(_a0, _a1, _a2, _a3) 97 } else { 98 r0 = ret.Error(0) 99 } 100 101 return r0 102 } 103 104 // CartCache_CacheCart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CacheCart' 105 type CartCache_CacheCart_Call struct { 106 *mock.Call 107 } 108 109 // CacheCart is a helper method to define mock.On call 110 // - _a0 context.Context 111 // - _a1 *web.Session 112 // - _a2 application.CartCacheIdentifier 113 // - _a3 *cart.Cart 114 func (_e *CartCache_Expecter) CacheCart(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *CartCache_CacheCart_Call { 115 return &CartCache_CacheCart_Call{Call: _e.mock.On("CacheCart", _a0, _a1, _a2, _a3)} 116 } 117 118 func (_c *CartCache_CacheCart_Call) Run(run func(_a0 context.Context, _a1 *web.Session, _a2 application.CartCacheIdentifier, _a3 *cart.Cart)) *CartCache_CacheCart_Call { 119 _c.Call.Run(func(args mock.Arguments) { 120 run(args[0].(context.Context), args[1].(*web.Session), args[2].(application.CartCacheIdentifier), args[3].(*cart.Cart)) 121 }) 122 return _c 123 } 124 125 func (_c *CartCache_CacheCart_Call) Return(_a0 error) *CartCache_CacheCart_Call { 126 _c.Call.Return(_a0) 127 return _c 128 } 129 130 func (_c *CartCache_CacheCart_Call) RunAndReturn(run func(context.Context, *web.Session, application.CartCacheIdentifier, *cart.Cart) error) *CartCache_CacheCart_Call { 131 _c.Call.Return(run) 132 return _c 133 } 134 135 // Delete provides a mock function with given fields: _a0, _a1, _a2 136 func (_m *CartCache) Delete(_a0 context.Context, _a1 *web.Session, _a2 application.CartCacheIdentifier) error { 137 ret := _m.Called(_a0, _a1, _a2) 138 139 if len(ret) == 0 { 140 panic("no return value specified for Delete") 141 } 142 143 var r0 error 144 if rf, ok := ret.Get(0).(func(context.Context, *web.Session, application.CartCacheIdentifier) error); ok { 145 r0 = rf(_a0, _a1, _a2) 146 } else { 147 r0 = ret.Error(0) 148 } 149 150 return r0 151 } 152 153 // CartCache_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' 154 type CartCache_Delete_Call struct { 155 *mock.Call 156 } 157 158 // Delete is a helper method to define mock.On call 159 // - _a0 context.Context 160 // - _a1 *web.Session 161 // - _a2 application.CartCacheIdentifier 162 func (_e *CartCache_Expecter) Delete(_a0 interface{}, _a1 interface{}, _a2 interface{}) *CartCache_Delete_Call { 163 return &CartCache_Delete_Call{Call: _e.mock.On("Delete", _a0, _a1, _a2)} 164 } 165 166 func (_c *CartCache_Delete_Call) Run(run func(_a0 context.Context, _a1 *web.Session, _a2 application.CartCacheIdentifier)) *CartCache_Delete_Call { 167 _c.Call.Run(func(args mock.Arguments) { 168 run(args[0].(context.Context), args[1].(*web.Session), args[2].(application.CartCacheIdentifier)) 169 }) 170 return _c 171 } 172 173 func (_c *CartCache_Delete_Call) Return(_a0 error) *CartCache_Delete_Call { 174 _c.Call.Return(_a0) 175 return _c 176 } 177 178 func (_c *CartCache_Delete_Call) RunAndReturn(run func(context.Context, *web.Session, application.CartCacheIdentifier) error) *CartCache_Delete_Call { 179 _c.Call.Return(run) 180 return _c 181 } 182 183 // DeleteAll provides a mock function with given fields: _a0, _a1 184 func (_m *CartCache) DeleteAll(_a0 context.Context, _a1 *web.Session) error { 185 ret := _m.Called(_a0, _a1) 186 187 if len(ret) == 0 { 188 panic("no return value specified for DeleteAll") 189 } 190 191 var r0 error 192 if rf, ok := ret.Get(0).(func(context.Context, *web.Session) error); ok { 193 r0 = rf(_a0, _a1) 194 } else { 195 r0 = ret.Error(0) 196 } 197 198 return r0 199 } 200 201 // CartCache_DeleteAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteAll' 202 type CartCache_DeleteAll_Call struct { 203 *mock.Call 204 } 205 206 // DeleteAll is a helper method to define mock.On call 207 // - _a0 context.Context 208 // - _a1 *web.Session 209 func (_e *CartCache_Expecter) DeleteAll(_a0 interface{}, _a1 interface{}) *CartCache_DeleteAll_Call { 210 return &CartCache_DeleteAll_Call{Call: _e.mock.On("DeleteAll", _a0, _a1)} 211 } 212 213 func (_c *CartCache_DeleteAll_Call) Run(run func(_a0 context.Context, _a1 *web.Session)) *CartCache_DeleteAll_Call { 214 _c.Call.Run(func(args mock.Arguments) { 215 run(args[0].(context.Context), args[1].(*web.Session)) 216 }) 217 return _c 218 } 219 220 func (_c *CartCache_DeleteAll_Call) Return(_a0 error) *CartCache_DeleteAll_Call { 221 _c.Call.Return(_a0) 222 return _c 223 } 224 225 func (_c *CartCache_DeleteAll_Call) RunAndReturn(run func(context.Context, *web.Session) error) *CartCache_DeleteAll_Call { 226 _c.Call.Return(run) 227 return _c 228 } 229 230 // GetCart provides a mock function with given fields: _a0, _a1, _a2 231 func (_m *CartCache) GetCart(_a0 context.Context, _a1 *web.Session, _a2 application.CartCacheIdentifier) (*cart.Cart, error) { 232 ret := _m.Called(_a0, _a1, _a2) 233 234 if len(ret) == 0 { 235 panic("no return value specified for GetCart") 236 } 237 238 var r0 *cart.Cart 239 var r1 error 240 if rf, ok := ret.Get(0).(func(context.Context, *web.Session, application.CartCacheIdentifier) (*cart.Cart, error)); ok { 241 return rf(_a0, _a1, _a2) 242 } 243 if rf, ok := ret.Get(0).(func(context.Context, *web.Session, application.CartCacheIdentifier) *cart.Cart); ok { 244 r0 = rf(_a0, _a1, _a2) 245 } else { 246 if ret.Get(0) != nil { 247 r0 = ret.Get(0).(*cart.Cart) 248 } 249 } 250 251 if rf, ok := ret.Get(1).(func(context.Context, *web.Session, application.CartCacheIdentifier) error); ok { 252 r1 = rf(_a0, _a1, _a2) 253 } else { 254 r1 = ret.Error(1) 255 } 256 257 return r0, r1 258 } 259 260 // CartCache_GetCart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCart' 261 type CartCache_GetCart_Call struct { 262 *mock.Call 263 } 264 265 // GetCart is a helper method to define mock.On call 266 // - _a0 context.Context 267 // - _a1 *web.Session 268 // - _a2 application.CartCacheIdentifier 269 func (_e *CartCache_Expecter) GetCart(_a0 interface{}, _a1 interface{}, _a2 interface{}) *CartCache_GetCart_Call { 270 return &CartCache_GetCart_Call{Call: _e.mock.On("GetCart", _a0, _a1, _a2)} 271 } 272 273 func (_c *CartCache_GetCart_Call) Run(run func(_a0 context.Context, _a1 *web.Session, _a2 application.CartCacheIdentifier)) *CartCache_GetCart_Call { 274 _c.Call.Run(func(args mock.Arguments) { 275 run(args[0].(context.Context), args[1].(*web.Session), args[2].(application.CartCacheIdentifier)) 276 }) 277 return _c 278 } 279 280 func (_c *CartCache_GetCart_Call) Return(_a0 *cart.Cart, _a1 error) *CartCache_GetCart_Call { 281 _c.Call.Return(_a0, _a1) 282 return _c 283 } 284 285 func (_c *CartCache_GetCart_Call) RunAndReturn(run func(context.Context, *web.Session, application.CartCacheIdentifier) (*cart.Cart, error)) *CartCache_GetCart_Call { 286 _c.Call.Return(run) 287 return _c 288 } 289 290 // Invalidate provides a mock function with given fields: _a0, _a1, _a2 291 func (_m *CartCache) Invalidate(_a0 context.Context, _a1 *web.Session, _a2 application.CartCacheIdentifier) error { 292 ret := _m.Called(_a0, _a1, _a2) 293 294 if len(ret) == 0 { 295 panic("no return value specified for Invalidate") 296 } 297 298 var r0 error 299 if rf, ok := ret.Get(0).(func(context.Context, *web.Session, application.CartCacheIdentifier) error); ok { 300 r0 = rf(_a0, _a1, _a2) 301 } else { 302 r0 = ret.Error(0) 303 } 304 305 return r0 306 } 307 308 // CartCache_Invalidate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Invalidate' 309 type CartCache_Invalidate_Call struct { 310 *mock.Call 311 } 312 313 // Invalidate is a helper method to define mock.On call 314 // - _a0 context.Context 315 // - _a1 *web.Session 316 // - _a2 application.CartCacheIdentifier 317 func (_e *CartCache_Expecter) Invalidate(_a0 interface{}, _a1 interface{}, _a2 interface{}) *CartCache_Invalidate_Call { 318 return &CartCache_Invalidate_Call{Call: _e.mock.On("Invalidate", _a0, _a1, _a2)} 319 } 320 321 func (_c *CartCache_Invalidate_Call) Run(run func(_a0 context.Context, _a1 *web.Session, _a2 application.CartCacheIdentifier)) *CartCache_Invalidate_Call { 322 _c.Call.Run(func(args mock.Arguments) { 323 run(args[0].(context.Context), args[1].(*web.Session), args[2].(application.CartCacheIdentifier)) 324 }) 325 return _c 326 } 327 328 func (_c *CartCache_Invalidate_Call) Return(_a0 error) *CartCache_Invalidate_Call { 329 _c.Call.Return(_a0) 330 return _c 331 } 332 333 func (_c *CartCache_Invalidate_Call) RunAndReturn(run func(context.Context, *web.Session, application.CartCacheIdentifier) error) *CartCache_Invalidate_Call { 334 _c.Call.Return(run) 335 return _c 336 } 337 338 // NewCartCache creates a new instance of CartCache. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 339 // The first argument is typically a *testing.T value. 340 func NewCartCache(t interface { 341 mock.TestingT 342 Cleanup(func()) 343 }) *CartCache { 344 mock := &CartCache{} 345 mock.Mock.Test(t) 346 347 t.Cleanup(func() { mock.AssertExpectations(t) }) 348 349 return mock 350 }