mock_directory_manager_test.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. // Code generated by mockery; DO NOT EDIT.
  2. // github.com/vektra/mockery
  3. // template: testify
  4. package http
  5. import (
  6. "context"
  7. "github.com/mk6i/open-oscar-server/state"
  8. mock "github.com/stretchr/testify/mock"
  9. )
  10. // 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.
  11. // The first argument is typically a *testing.T value.
  12. func newMockDirectoryManager(t interface {
  13. mock.TestingT
  14. Cleanup(func())
  15. }) *mockDirectoryManager {
  16. mock := &mockDirectoryManager{}
  17. mock.Mock.Test(t)
  18. t.Cleanup(func() { mock.AssertExpectations(t) })
  19. return mock
  20. }
  21. // mockDirectoryManager is an autogenerated mock type for the DirectoryManager type
  22. type mockDirectoryManager struct {
  23. mock.Mock
  24. }
  25. type mockDirectoryManager_Expecter struct {
  26. mock *mock.Mock
  27. }
  28. func (_m *mockDirectoryManager) EXPECT() *mockDirectoryManager_Expecter {
  29. return &mockDirectoryManager_Expecter{mock: &_m.Mock}
  30. }
  31. // Categories provides a mock function for the type mockDirectoryManager
  32. func (_mock *mockDirectoryManager) Categories(ctx context.Context) ([]state.Category, error) {
  33. ret := _mock.Called(ctx)
  34. if len(ret) == 0 {
  35. panic("no return value specified for Categories")
  36. }
  37. var r0 []state.Category
  38. var r1 error
  39. if returnFunc, ok := ret.Get(0).(func(context.Context) ([]state.Category, error)); ok {
  40. return returnFunc(ctx)
  41. }
  42. if returnFunc, ok := ret.Get(0).(func(context.Context) []state.Category); ok {
  43. r0 = returnFunc(ctx)
  44. } else {
  45. if ret.Get(0) != nil {
  46. r0 = ret.Get(0).([]state.Category)
  47. }
  48. }
  49. if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
  50. r1 = returnFunc(ctx)
  51. } else {
  52. r1 = ret.Error(1)
  53. }
  54. return r0, r1
  55. }
  56. // mockDirectoryManager_Categories_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Categories'
  57. type mockDirectoryManager_Categories_Call struct {
  58. *mock.Call
  59. }
  60. // Categories is a helper method to define mock.On call
  61. // - ctx context.Context
  62. func (_e *mockDirectoryManager_Expecter) Categories(ctx interface{}) *mockDirectoryManager_Categories_Call {
  63. return &mockDirectoryManager_Categories_Call{Call: _e.mock.On("Categories", ctx)}
  64. }
  65. func (_c *mockDirectoryManager_Categories_Call) Run(run func(ctx context.Context)) *mockDirectoryManager_Categories_Call {
  66. _c.Call.Run(func(args mock.Arguments) {
  67. var arg0 context.Context
  68. if args[0] != nil {
  69. arg0 = args[0].(context.Context)
  70. }
  71. run(
  72. arg0,
  73. )
  74. })
  75. return _c
  76. }
  77. func (_c *mockDirectoryManager_Categories_Call) Return(categorys []state.Category, err error) *mockDirectoryManager_Categories_Call {
  78. _c.Call.Return(categorys, err)
  79. return _c
  80. }
  81. func (_c *mockDirectoryManager_Categories_Call) RunAndReturn(run func(ctx context.Context) ([]state.Category, error)) *mockDirectoryManager_Categories_Call {
  82. _c.Call.Return(run)
  83. return _c
  84. }
  85. // CreateCategory provides a mock function for the type mockDirectoryManager
  86. func (_mock *mockDirectoryManager) CreateCategory(ctx context.Context, name string) (state.Category, error) {
  87. ret := _mock.Called(ctx, name)
  88. if len(ret) == 0 {
  89. panic("no return value specified for CreateCategory")
  90. }
  91. var r0 state.Category
  92. var r1 error
  93. if returnFunc, ok := ret.Get(0).(func(context.Context, string) (state.Category, error)); ok {
  94. return returnFunc(ctx, name)
  95. }
  96. if returnFunc, ok := ret.Get(0).(func(context.Context, string) state.Category); ok {
  97. r0 = returnFunc(ctx, name)
  98. } else {
  99. r0 = ret.Get(0).(state.Category)
  100. }
  101. if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
  102. r1 = returnFunc(ctx, name)
  103. } else {
  104. r1 = ret.Error(1)
  105. }
  106. return r0, r1
  107. }
  108. // mockDirectoryManager_CreateCategory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateCategory'
  109. type mockDirectoryManager_CreateCategory_Call struct {
  110. *mock.Call
  111. }
  112. // CreateCategory is a helper method to define mock.On call
  113. // - ctx context.Context
  114. // - name string
  115. func (_e *mockDirectoryManager_Expecter) CreateCategory(ctx interface{}, name interface{}) *mockDirectoryManager_CreateCategory_Call {
  116. return &mockDirectoryManager_CreateCategory_Call{Call: _e.mock.On("CreateCategory", ctx, name)}
  117. }
  118. func (_c *mockDirectoryManager_CreateCategory_Call) Run(run func(ctx context.Context, name string)) *mockDirectoryManager_CreateCategory_Call {
  119. _c.Call.Run(func(args mock.Arguments) {
  120. var arg0 context.Context
  121. if args[0] != nil {
  122. arg0 = args[0].(context.Context)
  123. }
  124. var arg1 string
  125. if args[1] != nil {
  126. arg1 = args[1].(string)
  127. }
  128. run(
  129. arg0,
  130. arg1,
  131. )
  132. })
  133. return _c
  134. }
  135. func (_c *mockDirectoryManager_CreateCategory_Call) Return(category state.Category, err error) *mockDirectoryManager_CreateCategory_Call {
  136. _c.Call.Return(category, err)
  137. return _c
  138. }
  139. func (_c *mockDirectoryManager_CreateCategory_Call) RunAndReturn(run func(ctx context.Context, name string) (state.Category, error)) *mockDirectoryManager_CreateCategory_Call {
  140. _c.Call.Return(run)
  141. return _c
  142. }
  143. // CreateKeyword provides a mock function for the type mockDirectoryManager
  144. func (_mock *mockDirectoryManager) CreateKeyword(ctx context.Context, name string, categoryID uint8) (state.Keyword, error) {
  145. ret := _mock.Called(ctx, name, categoryID)
  146. if len(ret) == 0 {
  147. panic("no return value specified for CreateKeyword")
  148. }
  149. var r0 state.Keyword
  150. var r1 error
  151. if returnFunc, ok := ret.Get(0).(func(context.Context, string, uint8) (state.Keyword, error)); ok {
  152. return returnFunc(ctx, name, categoryID)
  153. }
  154. if returnFunc, ok := ret.Get(0).(func(context.Context, string, uint8) state.Keyword); ok {
  155. r0 = returnFunc(ctx, name, categoryID)
  156. } else {
  157. r0 = ret.Get(0).(state.Keyword)
  158. }
  159. if returnFunc, ok := ret.Get(1).(func(context.Context, string, uint8) error); ok {
  160. r1 = returnFunc(ctx, name, categoryID)
  161. } else {
  162. r1 = ret.Error(1)
  163. }
  164. return r0, r1
  165. }
  166. // mockDirectoryManager_CreateKeyword_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateKeyword'
  167. type mockDirectoryManager_CreateKeyword_Call struct {
  168. *mock.Call
  169. }
  170. // CreateKeyword is a helper method to define mock.On call
  171. // - ctx context.Context
  172. // - name string
  173. // - categoryID uint8
  174. func (_e *mockDirectoryManager_Expecter) CreateKeyword(ctx interface{}, name interface{}, categoryID interface{}) *mockDirectoryManager_CreateKeyword_Call {
  175. return &mockDirectoryManager_CreateKeyword_Call{Call: _e.mock.On("CreateKeyword", ctx, name, categoryID)}
  176. }
  177. func (_c *mockDirectoryManager_CreateKeyword_Call) Run(run func(ctx context.Context, name string, categoryID uint8)) *mockDirectoryManager_CreateKeyword_Call {
  178. _c.Call.Run(func(args mock.Arguments) {
  179. var arg0 context.Context
  180. if args[0] != nil {
  181. arg0 = args[0].(context.Context)
  182. }
  183. var arg1 string
  184. if args[1] != nil {
  185. arg1 = args[1].(string)
  186. }
  187. var arg2 uint8
  188. if args[2] != nil {
  189. arg2 = args[2].(uint8)
  190. }
  191. run(
  192. arg0,
  193. arg1,
  194. arg2,
  195. )
  196. })
  197. return _c
  198. }
  199. func (_c *mockDirectoryManager_CreateKeyword_Call) Return(keyword state.Keyword, err error) *mockDirectoryManager_CreateKeyword_Call {
  200. _c.Call.Return(keyword, err)
  201. return _c
  202. }
  203. func (_c *mockDirectoryManager_CreateKeyword_Call) RunAndReturn(run func(ctx context.Context, name string, categoryID uint8) (state.Keyword, error)) *mockDirectoryManager_CreateKeyword_Call {
  204. _c.Call.Return(run)
  205. return _c
  206. }
  207. // DeleteCategory provides a mock function for the type mockDirectoryManager
  208. func (_mock *mockDirectoryManager) DeleteCategory(ctx context.Context, categoryID uint8) error {
  209. ret := _mock.Called(ctx, categoryID)
  210. if len(ret) == 0 {
  211. panic("no return value specified for DeleteCategory")
  212. }
  213. var r0 error
  214. if returnFunc, ok := ret.Get(0).(func(context.Context, uint8) error); ok {
  215. r0 = returnFunc(ctx, categoryID)
  216. } else {
  217. r0 = ret.Error(0)
  218. }
  219. return r0
  220. }
  221. // mockDirectoryManager_DeleteCategory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteCategory'
  222. type mockDirectoryManager_DeleteCategory_Call struct {
  223. *mock.Call
  224. }
  225. // DeleteCategory is a helper method to define mock.On call
  226. // - ctx context.Context
  227. // - categoryID uint8
  228. func (_e *mockDirectoryManager_Expecter) DeleteCategory(ctx interface{}, categoryID interface{}) *mockDirectoryManager_DeleteCategory_Call {
  229. return &mockDirectoryManager_DeleteCategory_Call{Call: _e.mock.On("DeleteCategory", ctx, categoryID)}
  230. }
  231. func (_c *mockDirectoryManager_DeleteCategory_Call) Run(run func(ctx context.Context, categoryID uint8)) *mockDirectoryManager_DeleteCategory_Call {
  232. _c.Call.Run(func(args mock.Arguments) {
  233. var arg0 context.Context
  234. if args[0] != nil {
  235. arg0 = args[0].(context.Context)
  236. }
  237. var arg1 uint8
  238. if args[1] != nil {
  239. arg1 = args[1].(uint8)
  240. }
  241. run(
  242. arg0,
  243. arg1,
  244. )
  245. })
  246. return _c
  247. }
  248. func (_c *mockDirectoryManager_DeleteCategory_Call) Return(err error) *mockDirectoryManager_DeleteCategory_Call {
  249. _c.Call.Return(err)
  250. return _c
  251. }
  252. func (_c *mockDirectoryManager_DeleteCategory_Call) RunAndReturn(run func(ctx context.Context, categoryID uint8) error) *mockDirectoryManager_DeleteCategory_Call {
  253. _c.Call.Return(run)
  254. return _c
  255. }
  256. // DeleteKeyword provides a mock function for the type mockDirectoryManager
  257. func (_mock *mockDirectoryManager) DeleteKeyword(ctx context.Context, id uint8) error {
  258. ret := _mock.Called(ctx, id)
  259. if len(ret) == 0 {
  260. panic("no return value specified for DeleteKeyword")
  261. }
  262. var r0 error
  263. if returnFunc, ok := ret.Get(0).(func(context.Context, uint8) error); ok {
  264. r0 = returnFunc(ctx, id)
  265. } else {
  266. r0 = ret.Error(0)
  267. }
  268. return r0
  269. }
  270. // mockDirectoryManager_DeleteKeyword_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteKeyword'
  271. type mockDirectoryManager_DeleteKeyword_Call struct {
  272. *mock.Call
  273. }
  274. // DeleteKeyword is a helper method to define mock.On call
  275. // - ctx context.Context
  276. // - id uint8
  277. func (_e *mockDirectoryManager_Expecter) DeleteKeyword(ctx interface{}, id interface{}) *mockDirectoryManager_DeleteKeyword_Call {
  278. return &mockDirectoryManager_DeleteKeyword_Call{Call: _e.mock.On("DeleteKeyword", ctx, id)}
  279. }
  280. func (_c *mockDirectoryManager_DeleteKeyword_Call) Run(run func(ctx context.Context, id uint8)) *mockDirectoryManager_DeleteKeyword_Call {
  281. _c.Call.Run(func(args mock.Arguments) {
  282. var arg0 context.Context
  283. if args[0] != nil {
  284. arg0 = args[0].(context.Context)
  285. }
  286. var arg1 uint8
  287. if args[1] != nil {
  288. arg1 = args[1].(uint8)
  289. }
  290. run(
  291. arg0,
  292. arg1,
  293. )
  294. })
  295. return _c
  296. }
  297. func (_c *mockDirectoryManager_DeleteKeyword_Call) Return(err error) *mockDirectoryManager_DeleteKeyword_Call {
  298. _c.Call.Return(err)
  299. return _c
  300. }
  301. func (_c *mockDirectoryManager_DeleteKeyword_Call) RunAndReturn(run func(ctx context.Context, id uint8) error) *mockDirectoryManager_DeleteKeyword_Call {
  302. _c.Call.Return(run)
  303. return _c
  304. }
  305. // KeywordsByCategory provides a mock function for the type mockDirectoryManager
  306. func (_mock *mockDirectoryManager) KeywordsByCategory(ctx context.Context, categoryID uint8) ([]state.Keyword, error) {
  307. ret := _mock.Called(ctx, categoryID)
  308. if len(ret) == 0 {
  309. panic("no return value specified for KeywordsByCategory")
  310. }
  311. var r0 []state.Keyword
  312. var r1 error
  313. if returnFunc, ok := ret.Get(0).(func(context.Context, uint8) ([]state.Keyword, error)); ok {
  314. return returnFunc(ctx, categoryID)
  315. }
  316. if returnFunc, ok := ret.Get(0).(func(context.Context, uint8) []state.Keyword); ok {
  317. r0 = returnFunc(ctx, categoryID)
  318. } else {
  319. if ret.Get(0) != nil {
  320. r0 = ret.Get(0).([]state.Keyword)
  321. }
  322. }
  323. if returnFunc, ok := ret.Get(1).(func(context.Context, uint8) error); ok {
  324. r1 = returnFunc(ctx, categoryID)
  325. } else {
  326. r1 = ret.Error(1)
  327. }
  328. return r0, r1
  329. }
  330. // mockDirectoryManager_KeywordsByCategory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'KeywordsByCategory'
  331. type mockDirectoryManager_KeywordsByCategory_Call struct {
  332. *mock.Call
  333. }
  334. // KeywordsByCategory is a helper method to define mock.On call
  335. // - ctx context.Context
  336. // - categoryID uint8
  337. func (_e *mockDirectoryManager_Expecter) KeywordsByCategory(ctx interface{}, categoryID interface{}) *mockDirectoryManager_KeywordsByCategory_Call {
  338. return &mockDirectoryManager_KeywordsByCategory_Call{Call: _e.mock.On("KeywordsByCategory", ctx, categoryID)}
  339. }
  340. func (_c *mockDirectoryManager_KeywordsByCategory_Call) Run(run func(ctx context.Context, categoryID uint8)) *mockDirectoryManager_KeywordsByCategory_Call {
  341. _c.Call.Run(func(args mock.Arguments) {
  342. var arg0 context.Context
  343. if args[0] != nil {
  344. arg0 = args[0].(context.Context)
  345. }
  346. var arg1 uint8
  347. if args[1] != nil {
  348. arg1 = args[1].(uint8)
  349. }
  350. run(
  351. arg0,
  352. arg1,
  353. )
  354. })
  355. return _c
  356. }
  357. func (_c *mockDirectoryManager_KeywordsByCategory_Call) Return(keywords []state.Keyword, err error) *mockDirectoryManager_KeywordsByCategory_Call {
  358. _c.Call.Return(keywords, err)
  359. return _c
  360. }
  361. func (_c *mockDirectoryManager_KeywordsByCategory_Call) RunAndReturn(run func(ctx context.Context, categoryID uint8) ([]state.Keyword, error)) *mockDirectoryManager_KeywordsByCategory_Call {
  362. _c.Call.Return(run)
  363. return _c
  364. }