mock_odir_service_test.go 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. // Code generated by mockery; DO NOT EDIT.
  2. // github.com/vektra/mockery
  3. // template: testify
  4. package oscar
  5. import (
  6. "context"
  7. "github.com/mk6i/open-oscar-server/wire"
  8. mock "github.com/stretchr/testify/mock"
  9. )
  10. // newMockODirService creates a new instance of mockODirService. 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 newMockODirService(t interface {
  13. mock.TestingT
  14. Cleanup(func())
  15. }) *mockODirService {
  16. mock := &mockODirService{}
  17. mock.Mock.Test(t)
  18. t.Cleanup(func() { mock.AssertExpectations(t) })
  19. return mock
  20. }
  21. // mockODirService is an autogenerated mock type for the ODirService type
  22. type mockODirService struct {
  23. mock.Mock
  24. }
  25. type mockODirService_Expecter struct {
  26. mock *mock.Mock
  27. }
  28. func (_m *mockODirService) EXPECT() *mockODirService_Expecter {
  29. return &mockODirService_Expecter{mock: &_m.Mock}
  30. }
  31. // InfoQuery provides a mock function for the type mockODirService
  32. func (_mock *mockODirService) InfoQuery(ctx context.Context, inFrame wire.SNACFrame, inBody wire.SNAC_0x0F_0x02_InfoQuery) (wire.SNACMessage, error) {
  33. ret := _mock.Called(ctx, inFrame, inBody)
  34. if len(ret) == 0 {
  35. panic("no return value specified for InfoQuery")
  36. }
  37. var r0 wire.SNACMessage
  38. var r1 error
  39. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.SNACFrame, wire.SNAC_0x0F_0x02_InfoQuery) (wire.SNACMessage, error)); ok {
  40. return returnFunc(ctx, inFrame, inBody)
  41. }
  42. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.SNACFrame, wire.SNAC_0x0F_0x02_InfoQuery) wire.SNACMessage); ok {
  43. r0 = returnFunc(ctx, inFrame, inBody)
  44. } else {
  45. r0 = ret.Get(0).(wire.SNACMessage)
  46. }
  47. if returnFunc, ok := ret.Get(1).(func(context.Context, wire.SNACFrame, wire.SNAC_0x0F_0x02_InfoQuery) error); ok {
  48. r1 = returnFunc(ctx, inFrame, inBody)
  49. } else {
  50. r1 = ret.Error(1)
  51. }
  52. return r0, r1
  53. }
  54. // mockODirService_InfoQuery_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InfoQuery'
  55. type mockODirService_InfoQuery_Call struct {
  56. *mock.Call
  57. }
  58. // InfoQuery is a helper method to define mock.On call
  59. // - ctx context.Context
  60. // - inFrame wire.SNACFrame
  61. // - inBody wire.SNAC_0x0F_0x02_InfoQuery
  62. func (_e *mockODirService_Expecter) InfoQuery(ctx interface{}, inFrame interface{}, inBody interface{}) *mockODirService_InfoQuery_Call {
  63. return &mockODirService_InfoQuery_Call{Call: _e.mock.On("InfoQuery", ctx, inFrame, inBody)}
  64. }
  65. func (_c *mockODirService_InfoQuery_Call) Run(run func(ctx context.Context, inFrame wire.SNACFrame, inBody wire.SNAC_0x0F_0x02_InfoQuery)) *mockODirService_InfoQuery_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 wire.SNACFrame
  72. if args[1] != nil {
  73. arg1 = args[1].(wire.SNACFrame)
  74. }
  75. var arg2 wire.SNAC_0x0F_0x02_InfoQuery
  76. if args[2] != nil {
  77. arg2 = args[2].(wire.SNAC_0x0F_0x02_InfoQuery)
  78. }
  79. run(
  80. arg0,
  81. arg1,
  82. arg2,
  83. )
  84. })
  85. return _c
  86. }
  87. func (_c *mockODirService_InfoQuery_Call) Return(sNACMessage wire.SNACMessage, err error) *mockODirService_InfoQuery_Call {
  88. _c.Call.Return(sNACMessage, err)
  89. return _c
  90. }
  91. func (_c *mockODirService_InfoQuery_Call) RunAndReturn(run func(ctx context.Context, inFrame wire.SNACFrame, inBody wire.SNAC_0x0F_0x02_InfoQuery) (wire.SNACMessage, error)) *mockODirService_InfoQuery_Call {
  92. _c.Call.Return(run)
  93. return _c
  94. }
  95. // KeywordListQuery provides a mock function for the type mockODirService
  96. func (_mock *mockODirService) KeywordListQuery(ctx context.Context, inFrame wire.SNACFrame) (wire.SNACMessage, error) {
  97. ret := _mock.Called(ctx, inFrame)
  98. if len(ret) == 0 {
  99. panic("no return value specified for KeywordListQuery")
  100. }
  101. var r0 wire.SNACMessage
  102. var r1 error
  103. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.SNACFrame) (wire.SNACMessage, error)); ok {
  104. return returnFunc(ctx, inFrame)
  105. }
  106. if returnFunc, ok := ret.Get(0).(func(context.Context, wire.SNACFrame) wire.SNACMessage); ok {
  107. r0 = returnFunc(ctx, inFrame)
  108. } else {
  109. r0 = ret.Get(0).(wire.SNACMessage)
  110. }
  111. if returnFunc, ok := ret.Get(1).(func(context.Context, wire.SNACFrame) error); ok {
  112. r1 = returnFunc(ctx, inFrame)
  113. } else {
  114. r1 = ret.Error(1)
  115. }
  116. return r0, r1
  117. }
  118. // mockODirService_KeywordListQuery_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'KeywordListQuery'
  119. type mockODirService_KeywordListQuery_Call struct {
  120. *mock.Call
  121. }
  122. // KeywordListQuery is a helper method to define mock.On call
  123. // - ctx context.Context
  124. // - inFrame wire.SNACFrame
  125. func (_e *mockODirService_Expecter) KeywordListQuery(ctx interface{}, inFrame interface{}) *mockODirService_KeywordListQuery_Call {
  126. return &mockODirService_KeywordListQuery_Call{Call: _e.mock.On("KeywordListQuery", ctx, inFrame)}
  127. }
  128. func (_c *mockODirService_KeywordListQuery_Call) Run(run func(ctx context.Context, inFrame wire.SNACFrame)) *mockODirService_KeywordListQuery_Call {
  129. _c.Call.Run(func(args mock.Arguments) {
  130. var arg0 context.Context
  131. if args[0] != nil {
  132. arg0 = args[0].(context.Context)
  133. }
  134. var arg1 wire.SNACFrame
  135. if args[1] != nil {
  136. arg1 = args[1].(wire.SNACFrame)
  137. }
  138. run(
  139. arg0,
  140. arg1,
  141. )
  142. })
  143. return _c
  144. }
  145. func (_c *mockODirService_KeywordListQuery_Call) Return(sNACMessage wire.SNACMessage, err error) *mockODirService_KeywordListQuery_Call {
  146. _c.Call.Return(sNACMessage, err)
  147. return _c
  148. }
  149. func (_c *mockODirService_KeywordListQuery_Call) RunAndReturn(run func(ctx context.Context, inFrame wire.SNACFrame) (wire.SNACMessage, error)) *mockODirService_KeywordListQuery_Call {
  150. _c.Call.Return(run)
  151. return _c
  152. }