mock_chat_service_test.go 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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/state"
  8. "github.com/mk6i/open-oscar-server/wire"
  9. mock "github.com/stretchr/testify/mock"
  10. )
  11. // newMockChatService creates a new instance of mockChatService. 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 newMockChatService(t interface {
  14. mock.TestingT
  15. Cleanup(func())
  16. }) *mockChatService {
  17. if helper, ok := t.(interface{ Helper() }); ok {
  18. helper.Helper()
  19. }
  20. mock := &mockChatService{}
  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. // mockChatService is an autogenerated mock type for the ChatService type
  31. type mockChatService struct {
  32. mock.Mock
  33. }
  34. type mockChatService_Expecter struct {
  35. mock *mock.Mock
  36. }
  37. func (_m *mockChatService) EXPECT() *mockChatService_Expecter {
  38. return &mockChatService_Expecter{mock: &_m.Mock}
  39. }
  40. // ChannelMsgToHost provides a mock function for the type mockChatService
  41. func (_mock *mockChatService) ChannelMsgToHost(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x0E_0x05_ChatChannelMsgToHost) (*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_0x0E_0x05_ChatChannelMsgToHost) (*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_0x0E_0x05_ChatChannelMsgToHost) *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_0x0E_0x05_ChatChannelMsgToHost) error); ok {
  59. r1 = returnFunc(ctx, instance, inFrame, inBody)
  60. } else {
  61. r1 = ret.Error(1)
  62. }
  63. return r0, r1
  64. }
  65. // mockChatService_ChannelMsgToHost_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChannelMsgToHost'
  66. type mockChatService_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_0x0E_0x05_ChatChannelMsgToHost
  74. func (_e *mockChatService_Expecter) ChannelMsgToHost(ctx any, instance any, inFrame any, inBody any) *mockChatService_ChannelMsgToHost_Call {
  75. return &mockChatService_ChannelMsgToHost_Call{Call: _e.mock.On("ChannelMsgToHost", ctx, instance, inFrame, inBody)}
  76. }
  77. func (_c *mockChatService_ChannelMsgToHost_Call) Run(run func(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x0E_0x05_ChatChannelMsgToHost)) *mockChatService_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_0x0E_0x05_ChatChannelMsgToHost
  92. if args[3] != nil {
  93. arg3 = args[3].(wire.SNAC_0x0E_0x05_ChatChannelMsgToHost)
  94. }
  95. run(
  96. arg0,
  97. arg1,
  98. arg2,
  99. arg3,
  100. )
  101. })
  102. return _c
  103. }
  104. func (_c *mockChatService_ChannelMsgToHost_Call) Return(sNACMessage *wire.SNACMessage, err error) *mockChatService_ChannelMsgToHost_Call {
  105. _c.Call.Return(sNACMessage, err)
  106. return _c
  107. }
  108. func (_c *mockChatService_ChannelMsgToHost_Call) RunAndReturn(run func(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x0E_0x05_ChatChannelMsgToHost) (*wire.SNACMessage, error)) *mockChatService_ChannelMsgToHost_Call {
  109. _c.Call.Return(run)
  110. return _c
  111. }