mock_chat_room_retriever_test.go 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. if helper, ok := t.(interface{ Helper() }); ok {
  17. helper.Helper()
  18. }
  19. mock := &mockChatRoomRetriever{}
  20. mock.Mock.Test(t)
  21. t.Cleanup(func() {
  22. if helper, ok := t.(interface{ Helper() }); ok {
  23. helper.Helper()
  24. }
  25. mock.AssertExpectations(t)
  26. })
  27. return mock
  28. }
  29. // mockChatRoomRetriever is an autogenerated mock type for the ChatRoomRetriever type
  30. type mockChatRoomRetriever struct {
  31. mock.Mock
  32. }
  33. type mockChatRoomRetriever_Expecter struct {
  34. mock *mock.Mock
  35. }
  36. func (_m *mockChatRoomRetriever) EXPECT() *mockChatRoomRetriever_Expecter {
  37. return &mockChatRoomRetriever_Expecter{mock: &_m.Mock}
  38. }
  39. // AllChatRooms provides a mock function for the type mockChatRoomRetriever
  40. func (_mock *mockChatRoomRetriever) AllChatRooms(ctx context.Context, exchange uint16) ([]state.ChatRoom, error) {
  41. ret := _mock.Called(ctx, exchange)
  42. if len(ret) == 0 {
  43. panic("no return value specified for AllChatRooms")
  44. }
  45. var r0 []state.ChatRoom
  46. var r1 error
  47. if returnFunc, ok := ret.Get(0).(func(context.Context, uint16) ([]state.ChatRoom, error)); ok {
  48. return returnFunc(ctx, exchange)
  49. }
  50. if returnFunc, ok := ret.Get(0).(func(context.Context, uint16) []state.ChatRoom); ok {
  51. r0 = returnFunc(ctx, exchange)
  52. } else {
  53. if ret.Get(0) != nil {
  54. r0 = ret.Get(0).([]state.ChatRoom)
  55. }
  56. }
  57. if returnFunc, ok := ret.Get(1).(func(context.Context, uint16) error); ok {
  58. r1 = returnFunc(ctx, exchange)
  59. } else {
  60. r1 = ret.Error(1)
  61. }
  62. return r0, r1
  63. }
  64. // mockChatRoomRetriever_AllChatRooms_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllChatRooms'
  65. type mockChatRoomRetriever_AllChatRooms_Call struct {
  66. *mock.Call
  67. }
  68. // AllChatRooms is a helper method to define mock.On call
  69. // - ctx context.Context
  70. // - exchange uint16
  71. func (_e *mockChatRoomRetriever_Expecter) AllChatRooms(ctx any, exchange any) *mockChatRoomRetriever_AllChatRooms_Call {
  72. return &mockChatRoomRetriever_AllChatRooms_Call{Call: _e.mock.On("AllChatRooms", ctx, exchange)}
  73. }
  74. func (_c *mockChatRoomRetriever_AllChatRooms_Call) Run(run func(ctx context.Context, exchange uint16)) *mockChatRoomRetriever_AllChatRooms_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 uint16
  81. if args[1] != nil {
  82. arg1 = args[1].(uint16)
  83. }
  84. run(
  85. arg0,
  86. arg1,
  87. )
  88. })
  89. return _c
  90. }
  91. func (_c *mockChatRoomRetriever_AllChatRooms_Call) Return(chatRooms []state.ChatRoom, err error) *mockChatRoomRetriever_AllChatRooms_Call {
  92. _c.Call.Return(chatRooms, err)
  93. return _c
  94. }
  95. func (_c *mockChatRoomRetriever_AllChatRooms_Call) RunAndReturn(run func(ctx context.Context, exchange uint16) ([]state.ChatRoom, error)) *mockChatRoomRetriever_AllChatRooms_Call {
  96. _c.Call.Return(run)
  97. return _c
  98. }