mock_icbm_service_test.go 14 KB

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