github.com/miguelgrubin/gin-boilerplate@v0.0.0-20231208120009-f8f00c6d4138/mocks/pkg/petshop/domain/PetRepository.go (about) 1 // Code generated by mockery v2.35.3. DO NOT EDIT. 2 3 package domain 4 5 import ( 6 domain "github.com/miguelgrubin/gin-boilerplate/pkg/petshop/domain" 7 mock "github.com/stretchr/testify/mock" 8 9 shared "github.com/miguelgrubin/gin-boilerplate/pkg/shared" 10 ) 11 12 // PetRepository is an autogenerated mock type for the PetRepository type 13 type PetRepository struct { 14 mock.Mock 15 } 16 17 type PetRepository_Expecter struct { 18 mock *mock.Mock 19 } 20 21 func (_m *PetRepository) EXPECT() *PetRepository_Expecter { 22 return &PetRepository_Expecter{mock: &_m.Mock} 23 } 24 25 // Delete provides a mock function with given fields: _a0 26 func (_m *PetRepository) Delete(_a0 shared.EntityID) error { 27 ret := _m.Called(_a0) 28 29 var r0 error 30 if rf, ok := ret.Get(0).(func(shared.EntityID) error); ok { 31 r0 = rf(_a0) 32 } else { 33 r0 = ret.Error(0) 34 } 35 36 return r0 37 } 38 39 // PetRepository_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' 40 type PetRepository_Delete_Call struct { 41 *mock.Call 42 } 43 44 // Delete is a helper method to define mock.On call 45 // - _a0 shared.EntityID 46 func (_e *PetRepository_Expecter) Delete(_a0 interface{}) *PetRepository_Delete_Call { 47 return &PetRepository_Delete_Call{Call: _e.mock.On("Delete", _a0)} 48 } 49 50 func (_c *PetRepository_Delete_Call) Run(run func(_a0 shared.EntityID)) *PetRepository_Delete_Call { 51 _c.Call.Run(func(args mock.Arguments) { 52 run(args[0].(shared.EntityID)) 53 }) 54 return _c 55 } 56 57 func (_c *PetRepository_Delete_Call) Return(_a0 error) *PetRepository_Delete_Call { 58 _c.Call.Return(_a0) 59 return _c 60 } 61 62 func (_c *PetRepository_Delete_Call) RunAndReturn(run func(shared.EntityID) error) *PetRepository_Delete_Call { 63 _c.Call.Return(run) 64 return _c 65 } 66 67 // FindAll provides a mock function with given fields: 68 func (_m *PetRepository) FindAll() ([]domain.Pet, error) { 69 ret := _m.Called() 70 71 var r0 []domain.Pet 72 var r1 error 73 if rf, ok := ret.Get(0).(func() ([]domain.Pet, error)); ok { 74 return rf() 75 } 76 if rf, ok := ret.Get(0).(func() []domain.Pet); ok { 77 r0 = rf() 78 } else { 79 if ret.Get(0) != nil { 80 r0 = ret.Get(0).([]domain.Pet) 81 } 82 } 83 84 if rf, ok := ret.Get(1).(func() error); ok { 85 r1 = rf() 86 } else { 87 r1 = ret.Error(1) 88 } 89 90 return r0, r1 91 } 92 93 // PetRepository_FindAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindAll' 94 type PetRepository_FindAll_Call struct { 95 *mock.Call 96 } 97 98 // FindAll is a helper method to define mock.On call 99 func (_e *PetRepository_Expecter) FindAll() *PetRepository_FindAll_Call { 100 return &PetRepository_FindAll_Call{Call: _e.mock.On("FindAll")} 101 } 102 103 func (_c *PetRepository_FindAll_Call) Run(run func()) *PetRepository_FindAll_Call { 104 _c.Call.Run(func(args mock.Arguments) { 105 run() 106 }) 107 return _c 108 } 109 110 func (_c *PetRepository_FindAll_Call) Return(_a0 []domain.Pet, _a1 error) *PetRepository_FindAll_Call { 111 _c.Call.Return(_a0, _a1) 112 return _c 113 } 114 115 func (_c *PetRepository_FindAll_Call) RunAndReturn(run func() ([]domain.Pet, error)) *PetRepository_FindAll_Call { 116 _c.Call.Return(run) 117 return _c 118 } 119 120 // FindOne provides a mock function with given fields: _a0 121 func (_m *PetRepository) FindOne(_a0 shared.EntityID) (*domain.Pet, error) { 122 ret := _m.Called(_a0) 123 124 var r0 *domain.Pet 125 var r1 error 126 if rf, ok := ret.Get(0).(func(shared.EntityID) (*domain.Pet, error)); ok { 127 return rf(_a0) 128 } 129 if rf, ok := ret.Get(0).(func(shared.EntityID) *domain.Pet); ok { 130 r0 = rf(_a0) 131 } else { 132 if ret.Get(0) != nil { 133 r0 = ret.Get(0).(*domain.Pet) 134 } 135 } 136 137 if rf, ok := ret.Get(1).(func(shared.EntityID) error); ok { 138 r1 = rf(_a0) 139 } else { 140 r1 = ret.Error(1) 141 } 142 143 return r0, r1 144 } 145 146 // PetRepository_FindOne_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOne' 147 type PetRepository_FindOne_Call struct { 148 *mock.Call 149 } 150 151 // FindOne is a helper method to define mock.On call 152 // - _a0 shared.EntityID 153 func (_e *PetRepository_Expecter) FindOne(_a0 interface{}) *PetRepository_FindOne_Call { 154 return &PetRepository_FindOne_Call{Call: _e.mock.On("FindOne", _a0)} 155 } 156 157 func (_c *PetRepository_FindOne_Call) Run(run func(_a0 shared.EntityID)) *PetRepository_FindOne_Call { 158 _c.Call.Run(func(args mock.Arguments) { 159 run(args[0].(shared.EntityID)) 160 }) 161 return _c 162 } 163 164 func (_c *PetRepository_FindOne_Call) Return(_a0 *domain.Pet, _a1 error) *PetRepository_FindOne_Call { 165 _c.Call.Return(_a0, _a1) 166 return _c 167 } 168 169 func (_c *PetRepository_FindOne_Call) RunAndReturn(run func(shared.EntityID) (*domain.Pet, error)) *PetRepository_FindOne_Call { 170 _c.Call.Return(run) 171 return _c 172 } 173 174 // Save provides a mock function with given fields: _a0 175 func (_m *PetRepository) Save(_a0 domain.Pet) error { 176 ret := _m.Called(_a0) 177 178 var r0 error 179 if rf, ok := ret.Get(0).(func(domain.Pet) error); ok { 180 r0 = rf(_a0) 181 } else { 182 r0 = ret.Error(0) 183 } 184 185 return r0 186 } 187 188 // PetRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' 189 type PetRepository_Save_Call struct { 190 *mock.Call 191 } 192 193 // Save is a helper method to define mock.On call 194 // - _a0 domain.Pet 195 func (_e *PetRepository_Expecter) Save(_a0 interface{}) *PetRepository_Save_Call { 196 return &PetRepository_Save_Call{Call: _e.mock.On("Save", _a0)} 197 } 198 199 func (_c *PetRepository_Save_Call) Run(run func(_a0 domain.Pet)) *PetRepository_Save_Call { 200 _c.Call.Run(func(args mock.Arguments) { 201 run(args[0].(domain.Pet)) 202 }) 203 return _c 204 } 205 206 func (_c *PetRepository_Save_Call) Return(_a0 error) *PetRepository_Save_Call { 207 _c.Call.Return(_a0) 208 return _c 209 } 210 211 func (_c *PetRepository_Save_Call) RunAndReturn(run func(domain.Pet) error) *PetRepository_Save_Call { 212 _c.Call.Return(run) 213 return _c 214 } 215 216 // NewPetRepository creates a new instance of PetRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 217 // The first argument is typically a *testing.T value. 218 func NewPetRepository(t interface { 219 mock.TestingT 220 Cleanup(func()) 221 }) *PetRepository { 222 mock := &PetRepository{} 223 mock.Mock.Test(t) 224 225 t.Cleanup(func() { mock.AssertExpectations(t) }) 226 227 return mock 228 }