mock_profile_manager_test.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. // Code generated by mockery; DO NOT EDIT.
  2. // github.com/vektra/mockery
  3. // template: testify
  4. package foodgroup
  5. import (
  6. "context"
  7. "github.com/mk6i/open-oscar-server/state"
  8. "github.com/mk6i/open-oscar-server/wire"
  9. mock "github.com/stretchr/testify/mock"
  10. )
  11. // newMockProfileManager creates a new instance of mockProfileManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
  12. // The first argument is typically a *testing.T value.
  13. func newMockProfileManager(t interface {
  14. mock.TestingT
  15. Cleanup(func())
  16. }) *mockProfileManager {
  17. mock := &mockProfileManager{}
  18. mock.Mock.Test(t)
  19. t.Cleanup(func() { mock.AssertExpectations(t) })
  20. return mock
  21. }
  22. // mockProfileManager is an autogenerated mock type for the ProfileManager type
  23. type mockProfileManager struct {
  24. mock.Mock
  25. }
  26. type mockProfileManager_Expecter struct {
  27. mock *mock.Mock
  28. }
  29. func (_m *mockProfileManager) EXPECT() *mockProfileManager_Expecter {
  30. return &mockProfileManager_Expecter{mock: &_m.Mock}
  31. }
  32. // FindByAIMEmail provides a mock function for the type mockProfileManager
  33. func (_mock *mockProfileManager) FindByAIMEmail(ctx context.Context, email string) (state.User, error) {
  34. ret := _mock.Called(ctx, email)
  35. if len(ret) == 0 {
  36. panic("no return value specified for FindByAIMEmail")
  37. }
  38. var r0 state.User
  39. var r1 error
  40. if returnFunc, ok := ret.Get(0).(func(context.Context, string) (state.User, error)); ok {
  41. return returnFunc(ctx, email)
  42. }
  43. if returnFunc, ok := ret.Get(0).(func(context.Context, string) state.User); ok {
  44. r0 = returnFunc(ctx, email)
  45. } else {
  46. r0 = ret.Get(0).(state.User)
  47. }
  48. if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
  49. r1 = returnFunc(ctx, email)
  50. } else {
  51. r1 = ret.Error(1)
  52. }
  53. return r0, r1
  54. }
  55. // mockProfileManager_FindByAIMEmail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByAIMEmail'
  56. type mockProfileManager_FindByAIMEmail_Call struct {
  57. *mock.Call
  58. }
  59. // FindByAIMEmail is a helper method to define mock.On call
  60. // - ctx context.Context
  61. // - email string
  62. func (_e *mockProfileManager_Expecter) FindByAIMEmail(ctx interface{}, email interface{}) *mockProfileManager_FindByAIMEmail_Call {
  63. return &mockProfileManager_FindByAIMEmail_Call{Call: _e.mock.On("FindByAIMEmail", ctx, email)}
  64. }
  65. func (_c *mockProfileManager_FindByAIMEmail_Call) Run(run func(ctx context.Context, email string)) *mockProfileManager_FindByAIMEmail_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. var arg1 string
  72. if args[1] != nil {
  73. arg1 = args[1].(string)
  74. }
  75. run(
  76. arg0,
  77. arg1,
  78. )
  79. })
  80. return _c
  81. }
  82. func (_c *mockProfileManager_FindByAIMEmail_Call) Return(user state.User, err error) *mockProfileManager_FindByAIMEmail_Call {
  83. _c.Call.Return(user, err)
  84. return _c
  85. }
  86. func (_c *mockProfileManager_FindByAIMEmail_Call) RunAndReturn(run func(ctx context.Context, email string) (state.User, error)) *mockProfileManager_FindByAIMEmail_Call {
  87. _c.Call.Return(run)
  88. return _c
  89. }
  90. // FindByAIMKeyword provides a mock function for the type mockProfileManager
  91. func (_mock *mockProfileManager) FindByAIMKeyword(ctx context.Context, keyword string) ([]state.User, error) {
  92. ret := _mock.Called(ctx, keyword)
  93. if len(ret) == 0 {
  94. panic("no return value specified for FindByAIMKeyword")
  95. }
  96. var r0 []state.User
  97. var r1 error
  98. if returnFunc, ok := ret.Get(0).(func(context.Context, string) ([]state.User, error)); ok {
  99. return returnFunc(ctx, keyword)
  100. }
  101. if returnFunc, ok := ret.Get(0).(func(context.Context, string) []state.User); ok {
  102. r0 = returnFunc(ctx, keyword)
  103. } else {
  104. if ret.Get(0) != nil {
  105. r0 = ret.Get(0).([]state.User)
  106. }
  107. }
  108. if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
  109. r1 = returnFunc(ctx, keyword)
  110. } else {
  111. r1 = ret.Error(1)
  112. }
  113. return r0, r1
  114. }
  115. // mockProfileManager_FindByAIMKeyword_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByAIMKeyword'
  116. type mockProfileManager_FindByAIMKeyword_Call struct {
  117. *mock.Call
  118. }
  119. // FindByAIMKeyword is a helper method to define mock.On call
  120. // - ctx context.Context
  121. // - keyword string
  122. func (_e *mockProfileManager_Expecter) FindByAIMKeyword(ctx interface{}, keyword interface{}) *mockProfileManager_FindByAIMKeyword_Call {
  123. return &mockProfileManager_FindByAIMKeyword_Call{Call: _e.mock.On("FindByAIMKeyword", ctx, keyword)}
  124. }
  125. func (_c *mockProfileManager_FindByAIMKeyword_Call) Run(run func(ctx context.Context, keyword string)) *mockProfileManager_FindByAIMKeyword_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 string
  132. if args[1] != nil {
  133. arg1 = args[1].(string)
  134. }
  135. run(
  136. arg0,
  137. arg1,
  138. )
  139. })
  140. return _c
  141. }
  142. func (_c *mockProfileManager_FindByAIMKeyword_Call) Return(users []state.User, err error) *mockProfileManager_FindByAIMKeyword_Call {
  143. _c.Call.Return(users, err)
  144. return _c
  145. }
  146. func (_c *mockProfileManager_FindByAIMKeyword_Call) RunAndReturn(run func(ctx context.Context, keyword string) ([]state.User, error)) *mockProfileManager_FindByAIMKeyword_Call {
  147. _c.Call.Return(run)
  148. return _c
  149. }
  150. // FindByAIMNameAndAddr provides a mock function for the type mockProfileManager
  151. func (_mock *mockProfileManager) FindByAIMNameAndAddr(ctx context.Context, info state.AIMNameAndAddr) ([]state.User, error) {
  152. ret := _mock.Called(ctx, info)
  153. if len(ret) == 0 {
  154. panic("no return value specified for FindByAIMNameAndAddr")
  155. }
  156. var r0 []state.User
  157. var r1 error
  158. if returnFunc, ok := ret.Get(0).(func(context.Context, state.AIMNameAndAddr) ([]state.User, error)); ok {
  159. return returnFunc(ctx, info)
  160. }
  161. if returnFunc, ok := ret.Get(0).(func(context.Context, state.AIMNameAndAddr) []state.User); ok {
  162. r0 = returnFunc(ctx, info)
  163. } else {
  164. if ret.Get(0) != nil {
  165. r0 = ret.Get(0).([]state.User)
  166. }
  167. }
  168. if returnFunc, ok := ret.Get(1).(func(context.Context, state.AIMNameAndAddr) error); ok {
  169. r1 = returnFunc(ctx, info)
  170. } else {
  171. r1 = ret.Error(1)
  172. }
  173. return r0, r1
  174. }
  175. // mockProfileManager_FindByAIMNameAndAddr_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindByAIMNameAndAddr'
  176. type mockProfileManager_FindByAIMNameAndAddr_Call struct {
  177. *mock.Call
  178. }
  179. // FindByAIMNameAndAddr is a helper method to define mock.On call
  180. // - ctx context.Context
  181. // - info state.AIMNameAndAddr
  182. func (_e *mockProfileManager_Expecter) FindByAIMNameAndAddr(ctx interface{}, info interface{}) *mockProfileManager_FindByAIMNameAndAddr_Call {
  183. return &mockProfileManager_FindByAIMNameAndAddr_Call{Call: _e.mock.On("FindByAIMNameAndAddr", ctx, info)}
  184. }
  185. func (_c *mockProfileManager_FindByAIMNameAndAddr_Call) Run(run func(ctx context.Context, info state.AIMNameAndAddr)) *mockProfileManager_FindByAIMNameAndAddr_Call {
  186. _c.Call.Run(func(args mock.Arguments) {
  187. var arg0 context.Context
  188. if args[0] != nil {
  189. arg0 = args[0].(context.Context)
  190. }
  191. var arg1 state.AIMNameAndAddr
  192. if args[1] != nil {
  193. arg1 = args[1].(state.AIMNameAndAddr)
  194. }
  195. run(
  196. arg0,
  197. arg1,
  198. )
  199. })
  200. return _c
  201. }
  202. func (_c *mockProfileManager_FindByAIMNameAndAddr_Call) Return(users []state.User, err error) *mockProfileManager_FindByAIMNameAndAddr_Call {
  203. _c.Call.Return(users, err)
  204. return _c
  205. }
  206. func (_c *mockProfileManager_FindByAIMNameAndAddr_Call) RunAndReturn(run func(ctx context.Context, info state.AIMNameAndAddr) ([]state.User, error)) *mockProfileManager_FindByAIMNameAndAddr_Call {
  207. _c.Call.Return(run)
  208. return _c
  209. }
  210. // InterestList provides a mock function for the type mockProfileManager
  211. func (_mock *mockProfileManager) InterestList(ctx context.Context) ([]wire.ODirKeywordListItem, error) {
  212. ret := _mock.Called(ctx)
  213. if len(ret) == 0 {
  214. panic("no return value specified for InterestList")
  215. }
  216. var r0 []wire.ODirKeywordListItem
  217. var r1 error
  218. if returnFunc, ok := ret.Get(0).(func(context.Context) ([]wire.ODirKeywordListItem, error)); ok {
  219. return returnFunc(ctx)
  220. }
  221. if returnFunc, ok := ret.Get(0).(func(context.Context) []wire.ODirKeywordListItem); ok {
  222. r0 = returnFunc(ctx)
  223. } else {
  224. if ret.Get(0) != nil {
  225. r0 = ret.Get(0).([]wire.ODirKeywordListItem)
  226. }
  227. }
  228. if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
  229. r1 = returnFunc(ctx)
  230. } else {
  231. r1 = ret.Error(1)
  232. }
  233. return r0, r1
  234. }
  235. // mockProfileManager_InterestList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InterestList'
  236. type mockProfileManager_InterestList_Call struct {
  237. *mock.Call
  238. }
  239. // InterestList is a helper method to define mock.On call
  240. // - ctx context.Context
  241. func (_e *mockProfileManager_Expecter) InterestList(ctx interface{}) *mockProfileManager_InterestList_Call {
  242. return &mockProfileManager_InterestList_Call{Call: _e.mock.On("InterestList", ctx)}
  243. }
  244. func (_c *mockProfileManager_InterestList_Call) Run(run func(ctx context.Context)) *mockProfileManager_InterestList_Call {
  245. _c.Call.Run(func(args mock.Arguments) {
  246. var arg0 context.Context
  247. if args[0] != nil {
  248. arg0 = args[0].(context.Context)
  249. }
  250. run(
  251. arg0,
  252. )
  253. })
  254. return _c
  255. }
  256. func (_c *mockProfileManager_InterestList_Call) Return(oDirKeywordListItems []wire.ODirKeywordListItem, err error) *mockProfileManager_InterestList_Call {
  257. _c.Call.Return(oDirKeywordListItems, err)
  258. return _c
  259. }
  260. func (_c *mockProfileManager_InterestList_Call) RunAndReturn(run func(ctx context.Context) ([]wire.ODirKeywordListItem, error)) *mockProfileManager_InterestList_Call {
  261. _c.Call.Return(run)
  262. return _c
  263. }
  264. // Profile provides a mock function for the type mockProfileManager
  265. func (_mock *mockProfileManager) Profile(ctx context.Context, screenName state.IdentScreenName) (state.UserProfile, error) {
  266. ret := _mock.Called(ctx, screenName)
  267. if len(ret) == 0 {
  268. panic("no return value specified for Profile")
  269. }
  270. var r0 state.UserProfile
  271. var r1 error
  272. if returnFunc, ok := ret.Get(0).(func(context.Context, state.IdentScreenName) (state.UserProfile, error)); ok {
  273. return returnFunc(ctx, screenName)
  274. }
  275. if returnFunc, ok := ret.Get(0).(func(context.Context, state.IdentScreenName) state.UserProfile); ok {
  276. r0 = returnFunc(ctx, screenName)
  277. } else {
  278. r0 = ret.Get(0).(state.UserProfile)
  279. }
  280. if returnFunc, ok := ret.Get(1).(func(context.Context, state.IdentScreenName) error); ok {
  281. r1 = returnFunc(ctx, screenName)
  282. } else {
  283. r1 = ret.Error(1)
  284. }
  285. return r0, r1
  286. }
  287. // mockProfileManager_Profile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Profile'
  288. type mockProfileManager_Profile_Call struct {
  289. *mock.Call
  290. }
  291. // Profile is a helper method to define mock.On call
  292. // - ctx context.Context
  293. // - screenName state.IdentScreenName
  294. func (_e *mockProfileManager_Expecter) Profile(ctx interface{}, screenName interface{}) *mockProfileManager_Profile_Call {
  295. return &mockProfileManager_Profile_Call{Call: _e.mock.On("Profile", ctx, screenName)}
  296. }
  297. func (_c *mockProfileManager_Profile_Call) Run(run func(ctx context.Context, screenName state.IdentScreenName)) *mockProfileManager_Profile_Call {
  298. _c.Call.Run(func(args mock.Arguments) {
  299. var arg0 context.Context
  300. if args[0] != nil {
  301. arg0 = args[0].(context.Context)
  302. }
  303. var arg1 state.IdentScreenName
  304. if args[1] != nil {
  305. arg1 = args[1].(state.IdentScreenName)
  306. }
  307. run(
  308. arg0,
  309. arg1,
  310. )
  311. })
  312. return _c
  313. }
  314. func (_c *mockProfileManager_Profile_Call) Return(userProfile state.UserProfile, err error) *mockProfileManager_Profile_Call {
  315. _c.Call.Return(userProfile, err)
  316. return _c
  317. }
  318. func (_c *mockProfileManager_Profile_Call) RunAndReturn(run func(ctx context.Context, screenName state.IdentScreenName) (state.UserProfile, error)) *mockProfileManager_Profile_Call {
  319. _c.Call.Return(run)
  320. return _c
  321. }
  322. // SetDirectoryInfo provides a mock function for the type mockProfileManager
  323. func (_mock *mockProfileManager) SetDirectoryInfo(ctx context.Context, screenName state.IdentScreenName, info state.AIMNameAndAddr) error {
  324. ret := _mock.Called(ctx, screenName, info)
  325. if len(ret) == 0 {
  326. panic("no return value specified for SetDirectoryInfo")
  327. }
  328. var r0 error
  329. if returnFunc, ok := ret.Get(0).(func(context.Context, state.IdentScreenName, state.AIMNameAndAddr) error); ok {
  330. r0 = returnFunc(ctx, screenName, info)
  331. } else {
  332. r0 = ret.Error(0)
  333. }
  334. return r0
  335. }
  336. // mockProfileManager_SetDirectoryInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetDirectoryInfo'
  337. type mockProfileManager_SetDirectoryInfo_Call struct {
  338. *mock.Call
  339. }
  340. // SetDirectoryInfo is a helper method to define mock.On call
  341. // - ctx context.Context
  342. // - screenName state.IdentScreenName
  343. // - info state.AIMNameAndAddr
  344. func (_e *mockProfileManager_Expecter) SetDirectoryInfo(ctx interface{}, screenName interface{}, info interface{}) *mockProfileManager_SetDirectoryInfo_Call {
  345. return &mockProfileManager_SetDirectoryInfo_Call{Call: _e.mock.On("SetDirectoryInfo", ctx, screenName, info)}
  346. }
  347. func (_c *mockProfileManager_SetDirectoryInfo_Call) Run(run func(ctx context.Context, screenName state.IdentScreenName, info state.AIMNameAndAddr)) *mockProfileManager_SetDirectoryInfo_Call {
  348. _c.Call.Run(func(args mock.Arguments) {
  349. var arg0 context.Context
  350. if args[0] != nil {
  351. arg0 = args[0].(context.Context)
  352. }
  353. var arg1 state.IdentScreenName
  354. if args[1] != nil {
  355. arg1 = args[1].(state.IdentScreenName)
  356. }
  357. var arg2 state.AIMNameAndAddr
  358. if args[2] != nil {
  359. arg2 = args[2].(state.AIMNameAndAddr)
  360. }
  361. run(
  362. arg0,
  363. arg1,
  364. arg2,
  365. )
  366. })
  367. return _c
  368. }
  369. func (_c *mockProfileManager_SetDirectoryInfo_Call) Return(err error) *mockProfileManager_SetDirectoryInfo_Call {
  370. _c.Call.Return(err)
  371. return _c
  372. }
  373. func (_c *mockProfileManager_SetDirectoryInfo_Call) RunAndReturn(run func(ctx context.Context, screenName state.IdentScreenName, info state.AIMNameAndAddr) error) *mockProfileManager_SetDirectoryInfo_Call {
  374. _c.Call.Return(run)
  375. return _c
  376. }
  377. // SetKeywords provides a mock function for the type mockProfileManager
  378. func (_mock *mockProfileManager) SetKeywords(ctx context.Context, screenName state.IdentScreenName, keywords [5]string) error {
  379. ret := _mock.Called(ctx, screenName, keywords)
  380. if len(ret) == 0 {
  381. panic("no return value specified for SetKeywords")
  382. }
  383. var r0 error
  384. if returnFunc, ok := ret.Get(0).(func(context.Context, state.IdentScreenName, [5]string) error); ok {
  385. r0 = returnFunc(ctx, screenName, keywords)
  386. } else {
  387. r0 = ret.Error(0)
  388. }
  389. return r0
  390. }
  391. // mockProfileManager_SetKeywords_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetKeywords'
  392. type mockProfileManager_SetKeywords_Call struct {
  393. *mock.Call
  394. }
  395. // SetKeywords is a helper method to define mock.On call
  396. // - ctx context.Context
  397. // - screenName state.IdentScreenName
  398. // - keywords [5]string
  399. func (_e *mockProfileManager_Expecter) SetKeywords(ctx interface{}, screenName interface{}, keywords interface{}) *mockProfileManager_SetKeywords_Call {
  400. return &mockProfileManager_SetKeywords_Call{Call: _e.mock.On("SetKeywords", ctx, screenName, keywords)}
  401. }
  402. func (_c *mockProfileManager_SetKeywords_Call) Run(run func(ctx context.Context, screenName state.IdentScreenName, keywords [5]string)) *mockProfileManager_SetKeywords_Call {
  403. _c.Call.Run(func(args mock.Arguments) {
  404. var arg0 context.Context
  405. if args[0] != nil {
  406. arg0 = args[0].(context.Context)
  407. }
  408. var arg1 state.IdentScreenName
  409. if args[1] != nil {
  410. arg1 = args[1].(state.IdentScreenName)
  411. }
  412. var arg2 [5]string
  413. if args[2] != nil {
  414. arg2 = args[2].([5]string)
  415. }
  416. run(
  417. arg0,
  418. arg1,
  419. arg2,
  420. )
  421. })
  422. return _c
  423. }
  424. func (_c *mockProfileManager_SetKeywords_Call) Return(err error) *mockProfileManager_SetKeywords_Call {
  425. _c.Call.Return(err)
  426. return _c
  427. }
  428. func (_c *mockProfileManager_SetKeywords_Call) RunAndReturn(run func(ctx context.Context, screenName state.IdentScreenName, keywords [5]string) error) *mockProfileManager_SetKeywords_Call {
  429. _c.Call.Return(run)
  430. return _c
  431. }
  432. // SetProfile provides a mock function for the type mockProfileManager
  433. func (_mock *mockProfileManager) SetProfile(ctx context.Context, screenName state.IdentScreenName, profile state.UserProfile) error {
  434. ret := _mock.Called(ctx, screenName, profile)
  435. if len(ret) == 0 {
  436. panic("no return value specified for SetProfile")
  437. }
  438. var r0 error
  439. if returnFunc, ok := ret.Get(0).(func(context.Context, state.IdentScreenName, state.UserProfile) error); ok {
  440. r0 = returnFunc(ctx, screenName, profile)
  441. } else {
  442. r0 = ret.Error(0)
  443. }
  444. return r0
  445. }
  446. // mockProfileManager_SetProfile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetProfile'
  447. type mockProfileManager_SetProfile_Call struct {
  448. *mock.Call
  449. }
  450. // SetProfile is a helper method to define mock.On call
  451. // - ctx context.Context
  452. // - screenName state.IdentScreenName
  453. // - profile state.UserProfile
  454. func (_e *mockProfileManager_Expecter) SetProfile(ctx interface{}, screenName interface{}, profile interface{}) *mockProfileManager_SetProfile_Call {
  455. return &mockProfileManager_SetProfile_Call{Call: _e.mock.On("SetProfile", ctx, screenName, profile)}
  456. }
  457. func (_c *mockProfileManager_SetProfile_Call) Run(run func(ctx context.Context, screenName state.IdentScreenName, profile state.UserProfile)) *mockProfileManager_SetProfile_Call {
  458. _c.Call.Run(func(args mock.Arguments) {
  459. var arg0 context.Context
  460. if args[0] != nil {
  461. arg0 = args[0].(context.Context)
  462. }
  463. var arg1 state.IdentScreenName
  464. if args[1] != nil {
  465. arg1 = args[1].(state.IdentScreenName)
  466. }
  467. var arg2 state.UserProfile
  468. if args[2] != nil {
  469. arg2 = args[2].(state.UserProfile)
  470. }
  471. run(
  472. arg0,
  473. arg1,
  474. arg2,
  475. )
  476. })
  477. return _c
  478. }
  479. func (_c *mockProfileManager_SetProfile_Call) Return(err error) *mockProfileManager_SetProfile_Call {
  480. _c.Call.Return(err)
  481. return _c
  482. }
  483. func (_c *mockProfileManager_SetProfile_Call) RunAndReturn(run func(ctx context.Context, screenName state.IdentScreenName, profile state.UserProfile) error) *mockProfileManager_SetProfile_Call {
  484. _c.Call.Return(run)
  485. return _c
  486. }
  487. // User provides a mock function for the type mockProfileManager
  488. func (_mock *mockProfileManager) User(ctx context.Context, screenName state.IdentScreenName) (*state.User, error) {
  489. ret := _mock.Called(ctx, screenName)
  490. if len(ret) == 0 {
  491. panic("no return value specified for User")
  492. }
  493. var r0 *state.User
  494. var r1 error
  495. if returnFunc, ok := ret.Get(0).(func(context.Context, state.IdentScreenName) (*state.User, error)); ok {
  496. return returnFunc(ctx, screenName)
  497. }
  498. if returnFunc, ok := ret.Get(0).(func(context.Context, state.IdentScreenName) *state.User); ok {
  499. r0 = returnFunc(ctx, screenName)
  500. } else {
  501. if ret.Get(0) != nil {
  502. r0 = ret.Get(0).(*state.User)
  503. }
  504. }
  505. if returnFunc, ok := ret.Get(1).(func(context.Context, state.IdentScreenName) error); ok {
  506. r1 = returnFunc(ctx, screenName)
  507. } else {
  508. r1 = ret.Error(1)
  509. }
  510. return r0, r1
  511. }
  512. // mockProfileManager_User_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'User'
  513. type mockProfileManager_User_Call struct {
  514. *mock.Call
  515. }
  516. // User is a helper method to define mock.On call
  517. // - ctx context.Context
  518. // - screenName state.IdentScreenName
  519. func (_e *mockProfileManager_Expecter) User(ctx interface{}, screenName interface{}) *mockProfileManager_User_Call {
  520. return &mockProfileManager_User_Call{Call: _e.mock.On("User", ctx, screenName)}
  521. }
  522. func (_c *mockProfileManager_User_Call) Run(run func(ctx context.Context, screenName state.IdentScreenName)) *mockProfileManager_User_Call {
  523. _c.Call.Run(func(args mock.Arguments) {
  524. var arg0 context.Context
  525. if args[0] != nil {
  526. arg0 = args[0].(context.Context)
  527. }
  528. var arg1 state.IdentScreenName
  529. if args[1] != nil {
  530. arg1 = args[1].(state.IdentScreenName)
  531. }
  532. run(
  533. arg0,
  534. arg1,
  535. )
  536. })
  537. return _c
  538. }
  539. func (_c *mockProfileManager_User_Call) Return(user *state.User, err error) *mockProfileManager_User_Call {
  540. _c.Call.Return(user, err)
  541. return _c
  542. }
  543. func (_c *mockProfileManager_User_Call) RunAndReturn(run func(ctx context.Context, screenName state.IdentScreenName) (*state.User, error)) *mockProfileManager_User_Call {
  544. _c.Call.Return(run)
  545. return _c
  546. }