mock_chat_room_retriever_test.go 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // Code generated by mockery; DO NOT EDIT.
  2. // github.com/vektra/mockery
  3. // template: testify
  4. package http
  5. import (
  6. "context"
  7. "github.com/mk6i/open-oscar-server/state"
  8. mock "github.com/stretchr/testify/mock"
  9. )
  10. // newMockChatRoomRetriever creates a new instance of mockChatRoomRetriever. 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 newMockChatRoomRetriever(t interface {
  13. mock.TestingT
  14. Cleanup(func())
  15. }) *mockChatRoomRetriever {
  16. mock := &mockChatRoomRetriever{}
  17. mock.Mock.Test(t)
  18. t.Cleanup(func() { mock.AssertExpectations(t) })
  19. return mock
  20. }
  21. // mockChatRoomRetriever is an autogenerated mock type for the ChatRoomRetriever type
  22. type mockChatRoomRetriever struct {
  23. mock.Mock
  24. }
  25. type mockChatRoomRetriever_Expecter struct {
  26. mock *mock.Mock
  27. }
  28. func (_m *mockChatRoomRetriever) EXPECT() *mockChatRoomRetriever_Expecter {
  29. return &mockChatRoomRetriever_Expecter{mock: &_m.Mock}
  30. }
  31. // AllChatRooms provides a mock function for the type mockChatRoomRetriever
  32. func (_mock *mockChatRoomRetriever) AllChatRooms(ctx context.Context, exchange uint16) ([]state.ChatRoom, error) {
  33. ret := _mock.Called(ctx, exchange)
  34. if len(ret) == 0 {
  35. panic("no return value specified for AllChatRooms")
  36. }
  37. var r0 []state.ChatRoom
  38. var r1 error
  39. if returnFunc, ok := ret.Get(0).(func(context.Context, uint16) ([]state.ChatRoom, error)); ok {
  40. return returnFunc(ctx, exchange)
  41. }
  42. if returnFunc, ok := ret.Get(0).(func(context.Context, uint16) []state.ChatRoom); ok {
  43. r0 = returnFunc(ctx, exchange)
  44. } else {
  45. if ret.Get(0) != nil {
  46. r0 = ret.Get(0).([]state.ChatRoom)
  47. }
  48. }
  49. if returnFunc, ok := ret.Get(1).(func(context.Context, uint16) error); ok {
  50. r1 = returnFunc(ctx, exchange)
  51. } else {
  52. r1 = ret.Error(1)
  53. }
  54. return r0, r1
  55. }
  56. // mockChatRoomRetriever_AllChatRooms_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllChatRooms'
  57. type mockChatRoomRetriever_AllChatRooms_Call struct {
  58. *mock.Call
  59. }
  60. // AllChatRooms is a helper method to define mock.On call
  61. // - ctx context.Context
  62. // - exchange uint16
  63. func (_e *mockChatRoomRetriever_Expecter) AllChatRooms(ctx interface{}, exchange interface{}) *mockChatRoomRetriever_AllChatRooms_Call {
  64. return &mockChatRoomRetriever_AllChatRooms_Call{Call: _e.mock.On("AllChatRooms", ctx, exchange)}
  65. }
  66. func (_c *mockChatRoomRetriever_AllChatRooms_Call) Run(run func(ctx context.Context, exchange uint16)) *mockChatRoomRetriever_AllChatRooms_Call {
  67. _c.Call.Run(func(args mock.Arguments) {
  68. var arg0 context.Context
  69. if args[0] != nil {
  70. arg0 = args[0].(context.Context)
  71. }
  72. var arg1 uint16
  73. if args[1] != nil {
  74. arg1 = args[1].(uint16)
  75. }
  76. run(
  77. arg0,
  78. arg1,
  79. )
  80. })
  81. return _c
  82. }
  83. func (_c *mockChatRoomRetriever_AllChatRooms_Call) Return(chatRooms []state.ChatRoom, err error) *mockChatRoomRetriever_AllChatRooms_Call {
  84. _c.Call.Return(chatRooms, err)
  85. return _c
  86. }
  87. func (_c *mockChatRoomRetriever_AllChatRooms_Call) RunAndReturn(run func(ctx context.Context, exchange uint16) ([]state.ChatRoom, error)) *mockChatRoomRetriever_AllChatRooms_Call {
  88. _c.Call.Return(run)
  89. return _c
  90. }