mock_locate_service_test.go 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. // newMockLocateService creates a new instance of mockLocateService. 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 newMockLocateService(t interface {
  14. mock.TestingT
  15. Cleanup(func())
  16. }) *mockLocateService {
  17. if helper, ok := t.(interface{ Helper() }); ok {
  18. helper.Helper()
  19. }
  20. mock := &mockLocateService{}
  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. // mockLocateService is an autogenerated mock type for the LocateService type
  31. type mockLocateService struct {
  32. mock.Mock
  33. }
  34. type mockLocateService_Expecter struct {
  35. mock *mock.Mock
  36. }
  37. func (_m *mockLocateService) EXPECT() *mockLocateService_Expecter {
  38. return &mockLocateService_Expecter{mock: &_m.Mock}
  39. }
  40. // DirInfo provides a mock function for the type mockLocateService
  41. func (_mock *mockLocateService) DirInfo(ctx context.Context, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x0B_LocateGetDirInfo) (wire.SNACMessage, error) {
  42. ret := _mock.Called(ctx, inFrame, inBody)
  43. if len(ret) == 0 {
  44. panic("no return value specified for DirInfo")
  45. }
  46. var r0 wire.SNACMessage
  47. var r1 error
  48. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.SNACFrame, wire.SNAC_0x02_0x0B_LocateGetDirInfo) (wire.SNACMessage, error)); ok {
  49. return returnFunc(ctx, inFrame, inBody)
  50. }
  51. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.SNACFrame, wire.SNAC_0x02_0x0B_LocateGetDirInfo) wire.SNACMessage); ok {
  52. r0 = returnFunc(ctx, inFrame, inBody)
  53. } else {
  54. r0 = ret.Get(0).(wire.SNACMessage)
  55. }
  56. if returnFunc, ok := ret.Get(1).(func(context.Context, wire.SNACFrame, wire.SNAC_0x02_0x0B_LocateGetDirInfo) error); ok {
  57. r1 = returnFunc(ctx, inFrame, inBody)
  58. } else {
  59. r1 = ret.Error(1)
  60. }
  61. return r0, r1
  62. }
  63. // mockLocateService_DirInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DirInfo'
  64. type mockLocateService_DirInfo_Call struct {
  65. *mock.Call
  66. }
  67. // DirInfo is a helper method to define mock.On call
  68. // - ctx context.Context
  69. // - inFrame wire.SNACFrame
  70. // - inBody wire.SNAC_0x02_0x0B_LocateGetDirInfo
  71. func (_e *mockLocateService_Expecter) DirInfo(ctx any, inFrame any, inBody any) *mockLocateService_DirInfo_Call {
  72. return &mockLocateService_DirInfo_Call{Call: _e.mock.On("DirInfo", ctx, inFrame, inBody)}
  73. }
  74. func (_c *mockLocateService_DirInfo_Call) Run(run func(ctx context.Context, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x0B_LocateGetDirInfo)) *mockLocateService_DirInfo_Call {
  75. _c.Call.Run(func(args mock.Arguments) {
  76. var arg0 context.Context
  77. if args[0] != nil {
  78. arg0 = args[0].(context.Context)
  79. }
  80. var arg1 wire.SNACFrame
  81. if args[1] != nil {
  82. arg1 = args[1].(wire.SNACFrame)
  83. }
  84. var arg2 wire.SNAC_0x02_0x0B_LocateGetDirInfo
  85. if args[2] != nil {
  86. arg2 = args[2].(wire.SNAC_0x02_0x0B_LocateGetDirInfo)
  87. }
  88. run(
  89. arg0,
  90. arg1,
  91. arg2,
  92. )
  93. })
  94. return _c
  95. }
  96. func (_c *mockLocateService_DirInfo_Call) Return(sNACMessage wire.SNACMessage, err error) *mockLocateService_DirInfo_Call {
  97. _c.Call.Return(sNACMessage, err)
  98. return _c
  99. }
  100. func (_c *mockLocateService_DirInfo_Call) RunAndReturn(run func(ctx context.Context, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x0B_LocateGetDirInfo) (wire.SNACMessage, error)) *mockLocateService_DirInfo_Call {
  101. _c.Call.Return(run)
  102. return _c
  103. }
  104. // UserInfoQuery provides a mock function for the type mockLocateService
  105. func (_mock *mockLocateService) UserInfoQuery(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x05_LocateUserInfoQuery) (wire.SNACMessage, error) {
  106. ret := _mock.Called(ctx, instance, inFrame, inBody)
  107. if len(ret) == 0 {
  108. panic("no return value specified for UserInfoQuery")
  109. }
  110. var r0 wire.SNACMessage
  111. var r1 error
  112. if returnFunc, ok := ret.Get(0).(func(context.Context, *state.SessionInstance, wire.SNACFrame, wire.SNAC_0x02_0x05_LocateUserInfoQuery) (wire.SNACMessage, error)); ok {
  113. return returnFunc(ctx, instance, inFrame, inBody)
  114. }
  115. if returnFunc, ok := ret.Get(0).(func(context.Context, *state.SessionInstance, wire.SNACFrame, wire.SNAC_0x02_0x05_LocateUserInfoQuery) wire.SNACMessage); ok {
  116. r0 = returnFunc(ctx, instance, inFrame, inBody)
  117. } else {
  118. r0 = ret.Get(0).(wire.SNACMessage)
  119. }
  120. if returnFunc, ok := ret.Get(1).(func(context.Context, *state.SessionInstance, wire.SNACFrame, wire.SNAC_0x02_0x05_LocateUserInfoQuery) error); ok {
  121. r1 = returnFunc(ctx, instance, inFrame, inBody)
  122. } else {
  123. r1 = ret.Error(1)
  124. }
  125. return r0, r1
  126. }
  127. // mockLocateService_UserInfoQuery_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UserInfoQuery'
  128. type mockLocateService_UserInfoQuery_Call struct {
  129. *mock.Call
  130. }
  131. // UserInfoQuery is a helper method to define mock.On call
  132. // - ctx context.Context
  133. // - instance *state.SessionInstance
  134. // - inFrame wire.SNACFrame
  135. // - inBody wire.SNAC_0x02_0x05_LocateUserInfoQuery
  136. func (_e *mockLocateService_Expecter) UserInfoQuery(ctx any, instance any, inFrame any, inBody any) *mockLocateService_UserInfoQuery_Call {
  137. return &mockLocateService_UserInfoQuery_Call{Call: _e.mock.On("UserInfoQuery", ctx, instance, inFrame, inBody)}
  138. }
  139. func (_c *mockLocateService_UserInfoQuery_Call) Run(run func(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x05_LocateUserInfoQuery)) *mockLocateService_UserInfoQuery_Call {
  140. _c.Call.Run(func(args mock.Arguments) {
  141. var arg0 context.Context
  142. if args[0] != nil {
  143. arg0 = args[0].(context.Context)
  144. }
  145. var arg1 *state.SessionInstance
  146. if args[1] != nil {
  147. arg1 = args[1].(*state.SessionInstance)
  148. }
  149. var arg2 wire.SNACFrame
  150. if args[2] != nil {
  151. arg2 = args[2].(wire.SNACFrame)
  152. }
  153. var arg3 wire.SNAC_0x02_0x05_LocateUserInfoQuery
  154. if args[3] != nil {
  155. arg3 = args[3].(wire.SNAC_0x02_0x05_LocateUserInfoQuery)
  156. }
  157. run(
  158. arg0,
  159. arg1,
  160. arg2,
  161. arg3,
  162. )
  163. })
  164. return _c
  165. }
  166. func (_c *mockLocateService_UserInfoQuery_Call) Return(sNACMessage wire.SNACMessage, err error) *mockLocateService_UserInfoQuery_Call {
  167. _c.Call.Return(sNACMessage, err)
  168. return _c
  169. }
  170. func (_c *mockLocateService_UserInfoQuery_Call) RunAndReturn(run func(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x05_LocateUserInfoQuery) (wire.SNACMessage, error)) *mockLocateService_UserInfoQuery_Call {
  171. _c.Call.Return(run)
  172. return _c
  173. }