mock_icq_user_finder_test.go 14 KB

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