flamingo.me/flamingo-commerce/v3@v3.11.0/category/domain/mocks/category_service.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 domain "flamingo.me/flamingo-commerce/v3/category/domain" 9 mock "github.com/stretchr/testify/mock" 10 ) 11 12 // CategoryService is an autogenerated mock type for the CategoryService type 13 type CategoryService struct { 14 mock.Mock 15 } 16 17 type CategoryService_Expecter struct { 18 mock *mock.Mock 19 } 20 21 func (_m *CategoryService) EXPECT() *CategoryService_Expecter { 22 return &CategoryService_Expecter{mock: &_m.Mock} 23 } 24 25 // Get provides a mock function with given fields: ctx, categoryCode 26 func (_m *CategoryService) Get(ctx context.Context, categoryCode string) (domain.Category, error) { 27 ret := _m.Called(ctx, categoryCode) 28 29 if len(ret) == 0 { 30 panic("no return value specified for Get") 31 } 32 33 var r0 domain.Category 34 var r1 error 35 if rf, ok := ret.Get(0).(func(context.Context, string) (domain.Category, error)); ok { 36 return rf(ctx, categoryCode) 37 } 38 if rf, ok := ret.Get(0).(func(context.Context, string) domain.Category); ok { 39 r0 = rf(ctx, categoryCode) 40 } else { 41 if ret.Get(0) != nil { 42 r0 = ret.Get(0).(domain.Category) 43 } 44 } 45 46 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 47 r1 = rf(ctx, categoryCode) 48 } else { 49 r1 = ret.Error(1) 50 } 51 52 return r0, r1 53 } 54 55 // CategoryService_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' 56 type CategoryService_Get_Call struct { 57 *mock.Call 58 } 59 60 // Get is a helper method to define mock.On call 61 // - ctx context.Context 62 // - categoryCode string 63 func (_e *CategoryService_Expecter) Get(ctx interface{}, categoryCode interface{}) *CategoryService_Get_Call { 64 return &CategoryService_Get_Call{Call: _e.mock.On("Get", ctx, categoryCode)} 65 } 66 67 func (_c *CategoryService_Get_Call) Run(run func(ctx context.Context, categoryCode string)) *CategoryService_Get_Call { 68 _c.Call.Run(func(args mock.Arguments) { 69 run(args[0].(context.Context), args[1].(string)) 70 }) 71 return _c 72 } 73 74 func (_c *CategoryService_Get_Call) Return(_a0 domain.Category, _a1 error) *CategoryService_Get_Call { 75 _c.Call.Return(_a0, _a1) 76 return _c 77 } 78 79 func (_c *CategoryService_Get_Call) RunAndReturn(run func(context.Context, string) (domain.Category, error)) *CategoryService_Get_Call { 80 _c.Call.Return(run) 81 return _c 82 } 83 84 // Tree provides a mock function with given fields: ctx, activeCategoryCode 85 func (_m *CategoryService) Tree(ctx context.Context, activeCategoryCode string) (domain.Tree, error) { 86 ret := _m.Called(ctx, activeCategoryCode) 87 88 if len(ret) == 0 { 89 panic("no return value specified for Tree") 90 } 91 92 var r0 domain.Tree 93 var r1 error 94 if rf, ok := ret.Get(0).(func(context.Context, string) (domain.Tree, error)); ok { 95 return rf(ctx, activeCategoryCode) 96 } 97 if rf, ok := ret.Get(0).(func(context.Context, string) domain.Tree); ok { 98 r0 = rf(ctx, activeCategoryCode) 99 } else { 100 if ret.Get(0) != nil { 101 r0 = ret.Get(0).(domain.Tree) 102 } 103 } 104 105 if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { 106 r1 = rf(ctx, activeCategoryCode) 107 } else { 108 r1 = ret.Error(1) 109 } 110 111 return r0, r1 112 } 113 114 // CategoryService_Tree_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tree' 115 type CategoryService_Tree_Call struct { 116 *mock.Call 117 } 118 119 // Tree is a helper method to define mock.On call 120 // - ctx context.Context 121 // - activeCategoryCode string 122 func (_e *CategoryService_Expecter) Tree(ctx interface{}, activeCategoryCode interface{}) *CategoryService_Tree_Call { 123 return &CategoryService_Tree_Call{Call: _e.mock.On("Tree", ctx, activeCategoryCode)} 124 } 125 126 func (_c *CategoryService_Tree_Call) Run(run func(ctx context.Context, activeCategoryCode string)) *CategoryService_Tree_Call { 127 _c.Call.Run(func(args mock.Arguments) { 128 run(args[0].(context.Context), args[1].(string)) 129 }) 130 return _c 131 } 132 133 func (_c *CategoryService_Tree_Call) Return(_a0 domain.Tree, _a1 error) *CategoryService_Tree_Call { 134 _c.Call.Return(_a0, _a1) 135 return _c 136 } 137 138 func (_c *CategoryService_Tree_Call) RunAndReturn(run func(context.Context, string) (domain.Tree, error)) *CategoryService_Tree_Call { 139 _c.Call.Return(run) 140 return _c 141 } 142 143 // NewCategoryService creates a new instance of CategoryService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 144 // The first argument is typically a *testing.T value. 145 func NewCategoryService(t interface { 146 mock.TestingT 147 Cleanup(func()) 148 }) *CategoryService { 149 mock := &CategoryService{} 150 mock.Mock.Test(t) 151 152 t.Cleanup(func() { mock.AssertExpectations(t) }) 153 154 return mock 155 }