mock_chat_room_creator_test.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. // newMockChatRoomCreator creates a new instance of mockChatRoomCreator. 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 newMockChatRoomCreator(t interface {
  13. mock.TestingT
  14. Cleanup(func())
  15. }) *mockChatRoomCreator {
  16. if helper, ok := t.(interface{ Helper() }); ok {
  17. helper.Helper()
  18. }
  19. mock := &mockChatRoomCreator{}
  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. // mockChatRoomCreator is an autogenerated mock type for the ChatRoomCreator type
  30. type mockChatRoomCreator struct {
  31. mock.Mock
  32. }
  33. type mockChatRoomCreator_Expecter struct {
  34. mock *mock.Mock
  35. }
  36. func (_m *mockChatRoomCreator) EXPECT() *mockChatRoomCreator_Expecter {
  37. return &mockChatRoomCreator_Expecter{mock: &_m.Mock}
  38. }
  39. // CreateChatRoom provides a mock function for the type mockChatRoomCreator
  40. func (_mock *mockChatRoomCreator) CreateChatRoom(ctx context.Context, chatRoom *state.ChatRoom) error {
  41. ret := _mock.Called(ctx, chatRoom)
  42. if len(ret) == 0 {
  43. panic("no return value specified for CreateChatRoom")
  44. }
  45. var r0 error
  46. if returnFunc, ok := ret.Get(0).(func(context.Context, *state.ChatRoom) error); ok {
  47. r0 = returnFunc(ctx, chatRoom)
  48. } else {
  49. r0 = ret.Error(0)
  50. }
  51. return r0
  52. }
  53. // mockChatRoomCreator_CreateChatRoom_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateChatRoom'
  54. type mockChatRoomCreator_CreateChatRoom_Call struct {
  55. *mock.Call
  56. }
  57. // CreateChatRoom is a helper method to define mock.On call
  58. // - ctx context.Context
  59. // - chatRoom *state.ChatRoom
  60. func (_e *mockChatRoomCreator_Expecter) CreateChatRoom(ctx any, chatRoom any) *mockChatRoomCreator_CreateChatRoom_Call {
  61. return &mockChatRoomCreator_CreateChatRoom_Call{Call: _e.mock.On("CreateChatRoom", ctx, chatRoom)}
  62. }
  63. func (_c *mockChatRoomCreator_CreateChatRoom_Call) Run(run func(ctx context.Context, chatRoom *state.ChatRoom)) *mockChatRoomCreator_CreateChatRoom_Call {
  64. _c.Call.Run(func(args mock.Arguments) {
  65. var arg0 context.Context
  66. if args[0] != nil {
  67. arg0 = args[0].(context.Context)
  68. }
  69. var arg1 *state.ChatRoom
  70. if args[1] != nil {
  71. arg1 = args[1].(*state.ChatRoom)
  72. }
  73. run(
  74. arg0,
  75. arg1,
  76. )
  77. })
  78. return _c
  79. }
  80. func (_c *mockChatRoomCreator_CreateChatRoom_Call) Return(err error) *mockChatRoomCreator_CreateChatRoom_Call {
  81. _c.Call.Return(err)
  82. return _c
  83. }
  84. func (_c *mockChatRoomCreator_CreateChatRoom_Call) RunAndReturn(run func(ctx context.Context, chatRoom *state.ChatRoom) error) *mockChatRoomCreator_CreateChatRoom_Call {
  85. _c.Call.Return(run)
  86. return _c
  87. }