mock_admin_service_test.go 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. // Code generated by mockery v2.53.3. DO NOT EDIT.
  2. package handler
  3. import (
  4. context "context"
  5. state "github.com/mk6i/retro-aim-server/state"
  6. mock "github.com/stretchr/testify/mock"
  7. wire "github.com/mk6i/retro-aim-server/wire"
  8. )
  9. // mockAdminService is an autogenerated mock type for the AdminService type
  10. type mockAdminService struct {
  11. mock.Mock
  12. }
  13. type mockAdminService_Expecter struct {
  14. mock *mock.Mock
  15. }
  16. func (_m *mockAdminService) EXPECT() *mockAdminService_Expecter {
  17. return &mockAdminService_Expecter{mock: &_m.Mock}
  18. }
  19. // ConfirmRequest provides a mock function with given fields: ctx, sess, frame
  20. func (_m *mockAdminService) ConfirmRequest(ctx context.Context, sess *state.Session, frame wire.SNACFrame) (wire.SNACMessage, error) {
  21. ret := _m.Called(ctx, sess, frame)
  22. if len(ret) == 0 {
  23. panic("no return value specified for ConfirmRequest")
  24. }
  25. var r0 wire.SNACMessage
  26. var r1 error
  27. if rf, ok := ret.Get(0).(func(context.Context, *state.Session, wire.SNACFrame) (wire.SNACMessage, error)); ok {
  28. return rf(ctx, sess, frame)
  29. }
  30. if rf, ok := ret.Get(0).(func(context.Context, *state.Session, wire.SNACFrame) wire.SNACMessage); ok {
  31. r0 = rf(ctx, sess, frame)
  32. } else {
  33. r0 = ret.Get(0).(wire.SNACMessage)
  34. }
  35. if rf, ok := ret.Get(1).(func(context.Context, *state.Session, wire.SNACFrame) error); ok {
  36. r1 = rf(ctx, sess, frame)
  37. } else {
  38. r1 = ret.Error(1)
  39. }
  40. return r0, r1
  41. }
  42. // mockAdminService_ConfirmRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConfirmRequest'
  43. type mockAdminService_ConfirmRequest_Call struct {
  44. *mock.Call
  45. }
  46. // ConfirmRequest is a helper method to define mock.On call
  47. // - ctx context.Context
  48. // - sess *state.Session
  49. // - frame wire.SNACFrame
  50. func (_e *mockAdminService_Expecter) ConfirmRequest(ctx interface{}, sess interface{}, frame interface{}) *mockAdminService_ConfirmRequest_Call {
  51. return &mockAdminService_ConfirmRequest_Call{Call: _e.mock.On("ConfirmRequest", ctx, sess, frame)}
  52. }
  53. func (_c *mockAdminService_ConfirmRequest_Call) Run(run func(ctx context.Context, sess *state.Session, frame wire.SNACFrame)) *mockAdminService_ConfirmRequest_Call {
  54. _c.Call.Run(func(args mock.Arguments) {
  55. run(args[0].(context.Context), args[1].(*state.Session), args[2].(wire.SNACFrame))
  56. })
  57. return _c
  58. }
  59. func (_c *mockAdminService_ConfirmRequest_Call) Return(_a0 wire.SNACMessage, _a1 error) *mockAdminService_ConfirmRequest_Call {
  60. _c.Call.Return(_a0, _a1)
  61. return _c
  62. }
  63. func (_c *mockAdminService_ConfirmRequest_Call) RunAndReturn(run func(context.Context, *state.Session, wire.SNACFrame) (wire.SNACMessage, error)) *mockAdminService_ConfirmRequest_Call {
  64. _c.Call.Return(run)
  65. return _c
  66. }
  67. // InfoChangeRequest provides a mock function with given fields: ctx, sess, frame, body
  68. func (_m *mockAdminService) InfoChangeRequest(ctx context.Context, sess *state.Session, frame wire.SNACFrame, body wire.SNAC_0x07_0x04_AdminInfoChangeRequest) (wire.SNACMessage, error) {
  69. ret := _m.Called(ctx, sess, frame, body)
  70. if len(ret) == 0 {
  71. panic("no return value specified for InfoChangeRequest")
  72. }
  73. var r0 wire.SNACMessage
  74. var r1 error
  75. if rf, ok := ret.Get(0).(func(context.Context, *state.Session, wire.SNACFrame, wire.SNAC_0x07_0x04_AdminInfoChangeRequest) (wire.SNACMessage, error)); ok {
  76. return rf(ctx, sess, frame, body)
  77. }
  78. if rf, ok := ret.Get(0).(func(context.Context, *state.Session, wire.SNACFrame, wire.SNAC_0x07_0x04_AdminInfoChangeRequest) wire.SNACMessage); ok {
  79. r0 = rf(ctx, sess, frame, body)
  80. } else {
  81. r0 = ret.Get(0).(wire.SNACMessage)
  82. }
  83. if rf, ok := ret.Get(1).(func(context.Context, *state.Session, wire.SNACFrame, wire.SNAC_0x07_0x04_AdminInfoChangeRequest) error); ok {
  84. r1 = rf(ctx, sess, frame, body)
  85. } else {
  86. r1 = ret.Error(1)
  87. }
  88. return r0, r1
  89. }
  90. // mockAdminService_InfoChangeRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InfoChangeRequest'
  91. type mockAdminService_InfoChangeRequest_Call struct {
  92. *mock.Call
  93. }
  94. // InfoChangeRequest is a helper method to define mock.On call
  95. // - ctx context.Context
  96. // - sess *state.Session
  97. // - frame wire.SNACFrame
  98. // - body wire.SNAC_0x07_0x04_AdminInfoChangeRequest
  99. func (_e *mockAdminService_Expecter) InfoChangeRequest(ctx interface{}, sess interface{}, frame interface{}, body interface{}) *mockAdminService_InfoChangeRequest_Call {
  100. return &mockAdminService_InfoChangeRequest_Call{Call: _e.mock.On("InfoChangeRequest", ctx, sess, frame, body)}
  101. }
  102. func (_c *mockAdminService_InfoChangeRequest_Call) Run(run func(ctx context.Context, sess *state.Session, frame wire.SNACFrame, body wire.SNAC_0x07_0x04_AdminInfoChangeRequest)) *mockAdminService_InfoChangeRequest_Call {
  103. _c.Call.Run(func(args mock.Arguments) {
  104. run(args[0].(context.Context), args[1].(*state.Session), args[2].(wire.SNACFrame), args[3].(wire.SNAC_0x07_0x04_AdminInfoChangeRequest))
  105. })
  106. return _c
  107. }
  108. func (_c *mockAdminService_InfoChangeRequest_Call) Return(_a0 wire.SNACMessage, _a1 error) *mockAdminService_InfoChangeRequest_Call {
  109. _c.Call.Return(_a0, _a1)
  110. return _c
  111. }
  112. func (_c *mockAdminService_InfoChangeRequest_Call) RunAndReturn(run func(context.Context, *state.Session, wire.SNACFrame, wire.SNAC_0x07_0x04_AdminInfoChangeRequest) (wire.SNACMessage, error)) *mockAdminService_InfoChangeRequest_Call {
  113. _c.Call.Return(run)
  114. return _c
  115. }
  116. // InfoQuery provides a mock function with given fields: ctx, sess, frame, body
  117. func (_m *mockAdminService) InfoQuery(ctx context.Context, sess *state.Session, frame wire.SNACFrame, body wire.SNAC_0x07_0x02_AdminInfoQuery) (wire.SNACMessage, error) {
  118. ret := _m.Called(ctx, sess, frame, body)
  119. if len(ret) == 0 {
  120. panic("no return value specified for InfoQuery")
  121. }
  122. var r0 wire.SNACMessage
  123. var r1 error
  124. if rf, ok := ret.Get(0).(func(context.Context, *state.Session, wire.SNACFrame, wire.SNAC_0x07_0x02_AdminInfoQuery) (wire.SNACMessage, error)); ok {
  125. return rf(ctx, sess, frame, body)
  126. }
  127. if rf, ok := ret.Get(0).(func(context.Context, *state.Session, wire.SNACFrame, wire.SNAC_0x07_0x02_AdminInfoQuery) wire.SNACMessage); ok {
  128. r0 = rf(ctx, sess, frame, body)
  129. } else {
  130. r0 = ret.Get(0).(wire.SNACMessage)
  131. }
  132. if rf, ok := ret.Get(1).(func(context.Context, *state.Session, wire.SNACFrame, wire.SNAC_0x07_0x02_AdminInfoQuery) error); ok {
  133. r1 = rf(ctx, sess, frame, body)
  134. } else {
  135. r1 = ret.Error(1)
  136. }
  137. return r0, r1
  138. }
  139. // mockAdminService_InfoQuery_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InfoQuery'
  140. type mockAdminService_InfoQuery_Call struct {
  141. *mock.Call
  142. }
  143. // InfoQuery is a helper method to define mock.On call
  144. // - ctx context.Context
  145. // - sess *state.Session
  146. // - frame wire.SNACFrame
  147. // - body wire.SNAC_0x07_0x02_AdminInfoQuery
  148. func (_e *mockAdminService_Expecter) InfoQuery(ctx interface{}, sess interface{}, frame interface{}, body interface{}) *mockAdminService_InfoQuery_Call {
  149. return &mockAdminService_InfoQuery_Call{Call: _e.mock.On("InfoQuery", ctx, sess, frame, body)}
  150. }
  151. func (_c *mockAdminService_InfoQuery_Call) Run(run func(ctx context.Context, sess *state.Session, frame wire.SNACFrame, body wire.SNAC_0x07_0x02_AdminInfoQuery)) *mockAdminService_InfoQuery_Call {
  152. _c.Call.Run(func(args mock.Arguments) {
  153. run(args[0].(context.Context), args[1].(*state.Session), args[2].(wire.SNACFrame), args[3].(wire.SNAC_0x07_0x02_AdminInfoQuery))
  154. })
  155. return _c
  156. }
  157. func (_c *mockAdminService_InfoQuery_Call) Return(_a0 wire.SNACMessage, _a1 error) *mockAdminService_InfoQuery_Call {
  158. _c.Call.Return(_a0, _a1)
  159. return _c
  160. }
  161. func (_c *mockAdminService_InfoQuery_Call) RunAndReturn(run func(context.Context, *state.Session, wire.SNACFrame, wire.SNAC_0x07_0x02_AdminInfoQuery) (wire.SNACMessage, error)) *mockAdminService_InfoQuery_Call {
  162. _c.Call.Return(run)
  163. return _c
  164. }
  165. // newMockAdminService creates a new instance of mockAdminService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
  166. // The first argument is typically a *testing.T value.
  167. func newMockAdminService(t interface {
  168. mock.TestingT
  169. Cleanup(func())
  170. }) *mockAdminService {
  171. mock := &mockAdminService{}
  172. mock.Mock.Test(t)
  173. t.Cleanup(func() { mock.AssertExpectations(t) })
  174. return mock
  175. }