mock_directory_manager_test.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. // Code generated by mockery v2.53.3. DO NOT EDIT.
  2. package http
  3. import (
  4. context "context"
  5. state "github.com/mk6i/retro-aim-server/state"
  6. mock "github.com/stretchr/testify/mock"
  7. )
  8. // mockDirectoryManager is an autogenerated mock type for the DirectoryManager type
  9. type mockDirectoryManager struct {
  10. mock.Mock
  11. }
  12. type mockDirectoryManager_Expecter struct {
  13. mock *mock.Mock
  14. }
  15. func (_m *mockDirectoryManager) EXPECT() *mockDirectoryManager_Expecter {
  16. return &mockDirectoryManager_Expecter{mock: &_m.Mock}
  17. }
  18. // Categories provides a mock function with given fields: ctx
  19. func (_m *mockDirectoryManager) Categories(ctx context.Context) ([]state.Category, error) {
  20. ret := _m.Called(ctx)
  21. if len(ret) == 0 {
  22. panic("no return value specified for Categories")
  23. }
  24. var r0 []state.Category
  25. var r1 error
  26. if rf, ok := ret.Get(0).(func(context.Context) ([]state.Category, error)); ok {
  27. return rf(ctx)
  28. }
  29. if rf, ok := ret.Get(0).(func(context.Context) []state.Category); ok {
  30. r0 = rf(ctx)
  31. } else {
  32. if ret.Get(0) != nil {
  33. r0 = ret.Get(0).([]state.Category)
  34. }
  35. }
  36. if rf, ok := ret.Get(1).(func(context.Context) error); ok {
  37. r1 = rf(ctx)
  38. } else {
  39. r1 = ret.Error(1)
  40. }
  41. return r0, r1
  42. }
  43. // mockDirectoryManager_Categories_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Categories'
  44. type mockDirectoryManager_Categories_Call struct {
  45. *mock.Call
  46. }
  47. // Categories is a helper method to define mock.On call
  48. // - ctx context.Context
  49. func (_e *mockDirectoryManager_Expecter) Categories(ctx interface{}) *mockDirectoryManager_Categories_Call {
  50. return &mockDirectoryManager_Categories_Call{Call: _e.mock.On("Categories", ctx)}
  51. }
  52. func (_c *mockDirectoryManager_Categories_Call) Run(run func(ctx context.Context)) *mockDirectoryManager_Categories_Call {
  53. _c.Call.Run(func(args mock.Arguments) {
  54. run(args[0].(context.Context))
  55. })
  56. return _c
  57. }
  58. func (_c *mockDirectoryManager_Categories_Call) Return(_a0 []state.Category, _a1 error) *mockDirectoryManager_Categories_Call {
  59. _c.Call.Return(_a0, _a1)
  60. return _c
  61. }
  62. func (_c *mockDirectoryManager_Categories_Call) RunAndReturn(run func(context.Context) ([]state.Category, error)) *mockDirectoryManager_Categories_Call {
  63. _c.Call.Return(run)
  64. return _c
  65. }
  66. // CreateCategory provides a mock function with given fields: ctx, name
  67. func (_m *mockDirectoryManager) CreateCategory(ctx context.Context, name string) (state.Category, error) {
  68. ret := _m.Called(ctx, name)
  69. if len(ret) == 0 {
  70. panic("no return value specified for CreateCategory")
  71. }
  72. var r0 state.Category
  73. var r1 error
  74. if rf, ok := ret.Get(0).(func(context.Context, string) (state.Category, error)); ok {
  75. return rf(ctx, name)
  76. }
  77. if rf, ok := ret.Get(0).(func(context.Context, string) state.Category); ok {
  78. r0 = rf(ctx, name)
  79. } else {
  80. r0 = ret.Get(0).(state.Category)
  81. }
  82. if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
  83. r1 = rf(ctx, name)
  84. } else {
  85. r1 = ret.Error(1)
  86. }
  87. return r0, r1
  88. }
  89. // mockDirectoryManager_CreateCategory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateCategory'
  90. type mockDirectoryManager_CreateCategory_Call struct {
  91. *mock.Call
  92. }
  93. // CreateCategory is a helper method to define mock.On call
  94. // - ctx context.Context
  95. // - name string
  96. func (_e *mockDirectoryManager_Expecter) CreateCategory(ctx interface{}, name interface{}) *mockDirectoryManager_CreateCategory_Call {
  97. return &mockDirectoryManager_CreateCategory_Call{Call: _e.mock.On("CreateCategory", ctx, name)}
  98. }
  99. func (_c *mockDirectoryManager_CreateCategory_Call) Run(run func(ctx context.Context, name string)) *mockDirectoryManager_CreateCategory_Call {
  100. _c.Call.Run(func(args mock.Arguments) {
  101. run(args[0].(context.Context), args[1].(string))
  102. })
  103. return _c
  104. }
  105. func (_c *mockDirectoryManager_CreateCategory_Call) Return(_a0 state.Category, _a1 error) *mockDirectoryManager_CreateCategory_Call {
  106. _c.Call.Return(_a0, _a1)
  107. return _c
  108. }
  109. func (_c *mockDirectoryManager_CreateCategory_Call) RunAndReturn(run func(context.Context, string) (state.Category, error)) *mockDirectoryManager_CreateCategory_Call {
  110. _c.Call.Return(run)
  111. return _c
  112. }
  113. // CreateKeyword provides a mock function with given fields: ctx, name, categoryID
  114. func (_m *mockDirectoryManager) CreateKeyword(ctx context.Context, name string, categoryID uint8) (state.Keyword, error) {
  115. ret := _m.Called(ctx, name, categoryID)
  116. if len(ret) == 0 {
  117. panic("no return value specified for CreateKeyword")
  118. }
  119. var r0 state.Keyword
  120. var r1 error
  121. if rf, ok := ret.Get(0).(func(context.Context, string, uint8) (state.Keyword, error)); ok {
  122. return rf(ctx, name, categoryID)
  123. }
  124. if rf, ok := ret.Get(0).(func(context.Context, string, uint8) state.Keyword); ok {
  125. r0 = rf(ctx, name, categoryID)
  126. } else {
  127. r0 = ret.Get(0).(state.Keyword)
  128. }
  129. if rf, ok := ret.Get(1).(func(context.Context, string, uint8) error); ok {
  130. r1 = rf(ctx, name, categoryID)
  131. } else {
  132. r1 = ret.Error(1)
  133. }
  134. return r0, r1
  135. }
  136. // mockDirectoryManager_CreateKeyword_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateKeyword'
  137. type mockDirectoryManager_CreateKeyword_Call struct {
  138. *mock.Call
  139. }
  140. // CreateKeyword is a helper method to define mock.On call
  141. // - ctx context.Context
  142. // - name string
  143. // - categoryID uint8
  144. func (_e *mockDirectoryManager_Expecter) CreateKeyword(ctx interface{}, name interface{}, categoryID interface{}) *mockDirectoryManager_CreateKeyword_Call {
  145. return &mockDirectoryManager_CreateKeyword_Call{Call: _e.mock.On("CreateKeyword", ctx, name, categoryID)}
  146. }
  147. func (_c *mockDirectoryManager_CreateKeyword_Call) Run(run func(ctx context.Context, name string, categoryID uint8)) *mockDirectoryManager_CreateKeyword_Call {
  148. _c.Call.Run(func(args mock.Arguments) {
  149. run(args[0].(context.Context), args[1].(string), args[2].(uint8))
  150. })
  151. return _c
  152. }
  153. func (_c *mockDirectoryManager_CreateKeyword_Call) Return(_a0 state.Keyword, _a1 error) *mockDirectoryManager_CreateKeyword_Call {
  154. _c.Call.Return(_a0, _a1)
  155. return _c
  156. }
  157. func (_c *mockDirectoryManager_CreateKeyword_Call) RunAndReturn(run func(context.Context, string, uint8) (state.Keyword, error)) *mockDirectoryManager_CreateKeyword_Call {
  158. _c.Call.Return(run)
  159. return _c
  160. }
  161. // DeleteCategory provides a mock function with given fields: ctx, categoryID
  162. func (_m *mockDirectoryManager) DeleteCategory(ctx context.Context, categoryID uint8) error {
  163. ret := _m.Called(ctx, categoryID)
  164. if len(ret) == 0 {
  165. panic("no return value specified for DeleteCategory")
  166. }
  167. var r0 error
  168. if rf, ok := ret.Get(0).(func(context.Context, uint8) error); ok {
  169. r0 = rf(ctx, categoryID)
  170. } else {
  171. r0 = ret.Error(0)
  172. }
  173. return r0
  174. }
  175. // mockDirectoryManager_DeleteCategory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteCategory'
  176. type mockDirectoryManager_DeleteCategory_Call struct {
  177. *mock.Call
  178. }
  179. // DeleteCategory is a helper method to define mock.On call
  180. // - ctx context.Context
  181. // - categoryID uint8
  182. func (_e *mockDirectoryManager_Expecter) DeleteCategory(ctx interface{}, categoryID interface{}) *mockDirectoryManager_DeleteCategory_Call {
  183. return &mockDirectoryManager_DeleteCategory_Call{Call: _e.mock.On("DeleteCategory", ctx, categoryID)}
  184. }
  185. func (_c *mockDirectoryManager_DeleteCategory_Call) Run(run func(ctx context.Context, categoryID uint8)) *mockDirectoryManager_DeleteCategory_Call {
  186. _c.Call.Run(func(args mock.Arguments) {
  187. run(args[0].(context.Context), args[1].(uint8))
  188. })
  189. return _c
  190. }
  191. func (_c *mockDirectoryManager_DeleteCategory_Call) Return(_a0 error) *mockDirectoryManager_DeleteCategory_Call {
  192. _c.Call.Return(_a0)
  193. return _c
  194. }
  195. func (_c *mockDirectoryManager_DeleteCategory_Call) RunAndReturn(run func(context.Context, uint8) error) *mockDirectoryManager_DeleteCategory_Call {
  196. _c.Call.Return(run)
  197. return _c
  198. }
  199. // DeleteKeyword provides a mock function with given fields: ctx, id
  200. func (_m *mockDirectoryManager) DeleteKeyword(ctx context.Context, id uint8) error {
  201. ret := _m.Called(ctx, id)
  202. if len(ret) == 0 {
  203. panic("no return value specified for DeleteKeyword")
  204. }
  205. var r0 error
  206. if rf, ok := ret.Get(0).(func(context.Context, uint8) error); ok {
  207. r0 = rf(ctx, id)
  208. } else {
  209. r0 = ret.Error(0)
  210. }
  211. return r0
  212. }
  213. // mockDirectoryManager_DeleteKeyword_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteKeyword'
  214. type mockDirectoryManager_DeleteKeyword_Call struct {
  215. *mock.Call
  216. }
  217. // DeleteKeyword is a helper method to define mock.On call
  218. // - ctx context.Context
  219. // - id uint8
  220. func (_e *mockDirectoryManager_Expecter) DeleteKeyword(ctx interface{}, id interface{}) *mockDirectoryManager_DeleteKeyword_Call {
  221. return &mockDirectoryManager_DeleteKeyword_Call{Call: _e.mock.On("DeleteKeyword", ctx, id)}
  222. }
  223. func (_c *mockDirectoryManager_DeleteKeyword_Call) Run(run func(ctx context.Context, id uint8)) *mockDirectoryManager_DeleteKeyword_Call {
  224. _c.Call.Run(func(args mock.Arguments) {
  225. run(args[0].(context.Context), args[1].(uint8))
  226. })
  227. return _c
  228. }
  229. func (_c *mockDirectoryManager_DeleteKeyword_Call) Return(_a0 error) *mockDirectoryManager_DeleteKeyword_Call {
  230. _c.Call.Return(_a0)
  231. return _c
  232. }
  233. func (_c *mockDirectoryManager_DeleteKeyword_Call) RunAndReturn(run func(context.Context, uint8) error) *mockDirectoryManager_DeleteKeyword_Call {
  234. _c.Call.Return(run)
  235. return _c
  236. }
  237. // KeywordsByCategory provides a mock function with given fields: ctx, categoryID
  238. func (_m *mockDirectoryManager) KeywordsByCategory(ctx context.Context, categoryID uint8) ([]state.Keyword, error) {
  239. ret := _m.Called(ctx, categoryID)
  240. if len(ret) == 0 {
  241. panic("no return value specified for KeywordsByCategory")
  242. }
  243. var r0 []state.Keyword
  244. var r1 error
  245. if rf, ok := ret.Get(0).(func(context.Context, uint8) ([]state.Keyword, error)); ok {
  246. return rf(ctx, categoryID)
  247. }
  248. if rf, ok := ret.Get(0).(func(context.Context, uint8) []state.Keyword); ok {
  249. r0 = rf(ctx, categoryID)
  250. } else {
  251. if ret.Get(0) != nil {
  252. r0 = ret.Get(0).([]state.Keyword)
  253. }
  254. }
  255. if rf, ok := ret.Get(1).(func(context.Context, uint8) error); ok {
  256. r1 = rf(ctx, categoryID)
  257. } else {
  258. r1 = ret.Error(1)
  259. }
  260. return r0, r1
  261. }
  262. // mockDirectoryManager_KeywordsByCategory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'KeywordsByCategory'
  263. type mockDirectoryManager_KeywordsByCategory_Call struct {
  264. *mock.Call
  265. }
  266. // KeywordsByCategory is a helper method to define mock.On call
  267. // - ctx context.Context
  268. // - categoryID uint8
  269. func (_e *mockDirectoryManager_Expecter) KeywordsByCategory(ctx interface{}, categoryID interface{}) *mockDirectoryManager_KeywordsByCategory_Call {
  270. return &mockDirectoryManager_KeywordsByCategory_Call{Call: _e.mock.On("KeywordsByCategory", ctx, categoryID)}
  271. }
  272. func (_c *mockDirectoryManager_KeywordsByCategory_Call) Run(run func(ctx context.Context, categoryID uint8)) *mockDirectoryManager_KeywordsByCategory_Call {
  273. _c.Call.Run(func(args mock.Arguments) {
  274. run(args[0].(context.Context), args[1].(uint8))
  275. })
  276. return _c
  277. }
  278. func (_c *mockDirectoryManager_KeywordsByCategory_Call) Return(_a0 []state.Keyword, _a1 error) *mockDirectoryManager_KeywordsByCategory_Call {
  279. _c.Call.Return(_a0, _a1)
  280. return _c
  281. }
  282. func (_c *mockDirectoryManager_KeywordsByCategory_Call) RunAndReturn(run func(context.Context, uint8) ([]state.Keyword, error)) *mockDirectoryManager_KeywordsByCategory_Call {
  283. _c.Call.Return(run)
  284. return _c
  285. }
  286. // newMockDirectoryManager creates a new instance of mockDirectoryManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
  287. // The first argument is typically a *testing.T value.
  288. func newMockDirectoryManager(t interface {
  289. mock.TestingT
  290. Cleanup(func())
  291. }) *mockDirectoryManager {
  292. mock := &mockDirectoryManager{}
  293. mock.Mock.Test(t)
  294. t.Cleanup(func() { mock.AssertExpectations(t) })
  295. return mock
  296. }