200 lines
5.9 KiB
Go
200 lines
5.9 KiB
Go
// Code generated by mockery; DO NOT EDIT.
|
|
// github.com/vektra/mockery
|
|
// template: testify
|
|
|
|
package mocks
|
|
|
|
import (
|
|
"context"
|
|
"mtusi-messenger/internal/domain"
|
|
|
|
"github.com/google/uuid"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// NewMockMessageService creates a new instance of MockMessageService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
// The first argument is typically a *testing.T value.
|
|
func NewMockMessageService(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockMessageService {
|
|
if helper, ok := t.(interface{ Helper() }); ok {
|
|
helper.Helper()
|
|
}
|
|
|
|
mock := &MockMessageService{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() {
|
|
if helper, ok := t.(interface{ Helper() }); ok {
|
|
helper.Helper()
|
|
}
|
|
mock.AssertExpectations(t)
|
|
})
|
|
|
|
return mock
|
|
}
|
|
|
|
// MockMessageService is an autogenerated mock type for the MessageService type
|
|
type MockMessageService struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type MockMessageService_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *MockMessageService) EXPECT() *MockMessageService_Expecter {
|
|
return &MockMessageService_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// History provides a mock function for the type MockMessageService
|
|
func (_mock *MockMessageService) History(ctx context.Context, callerID uuid.UUID, chatID uuid.UUID, after *domain.Cursor, limit int) (domain.Page[domain.Message], error) {
|
|
ret := _mock.Called(ctx, callerID, chatID, after, limit)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for History")
|
|
}
|
|
|
|
var r0 domain.Page[domain.Message]
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, uuid.UUID, uuid.UUID, *domain.Cursor, int) (domain.Page[domain.Message], error)); ok {
|
|
return returnFunc(ctx, callerID, chatID, after, limit)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, uuid.UUID, uuid.UUID, *domain.Cursor, int) domain.Page[domain.Message]); ok {
|
|
r0 = returnFunc(ctx, callerID, chatID, after, limit)
|
|
} else {
|
|
r0 = ret.Get(0).(domain.Page[domain.Message])
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, uuid.UUID, uuid.UUID, *domain.Cursor, int) error); ok {
|
|
r1 = returnFunc(ctx, callerID, chatID, after, limit)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// MockMessageService_History_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'History'
|
|
type MockMessageService_History_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// History is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - callerID uuid.UUID
|
|
// - chatID uuid.UUID
|
|
// - after *domain.Cursor
|
|
// - limit int
|
|
func (_e *MockMessageService_Expecter) History(ctx any, callerID any, chatID any, after any, limit any) *MockMessageService_History_Call {
|
|
return &MockMessageService_History_Call{Call: _e.mock.On("History", ctx, callerID, chatID, after, limit)}
|
|
}
|
|
|
|
func (_c *MockMessageService_History_Call) Run(run func(ctx context.Context, callerID uuid.UUID, chatID uuid.UUID, after *domain.Cursor, limit int)) *MockMessageService_History_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 uuid.UUID
|
|
if args[1] != nil {
|
|
arg1 = args[1].(uuid.UUID)
|
|
}
|
|
var arg2 uuid.UUID
|
|
if args[2] != nil {
|
|
arg2 = args[2].(uuid.UUID)
|
|
}
|
|
var arg3 *domain.Cursor
|
|
if args[3] != nil {
|
|
arg3 = args[3].(*domain.Cursor)
|
|
}
|
|
var arg4 int
|
|
if args[4] != nil {
|
|
arg4 = args[4].(int)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
arg2,
|
|
arg3,
|
|
arg4,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMessageService_History_Call) Return(page domain.Page[domain.Message], err error) *MockMessageService_History_Call {
|
|
_c.Call.Return(page, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMessageService_History_Call) RunAndReturn(run func(ctx context.Context, callerID uuid.UUID, chatID uuid.UUID, after *domain.Cursor, limit int) (domain.Page[domain.Message], error)) *MockMessageService_History_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Send provides a mock function for the type MockMessageService
|
|
func (_mock *MockMessageService) Send(ctx context.Context, draft domain.MessageDraft) (domain.Message, error) {
|
|
ret := _mock.Called(ctx, draft)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Send")
|
|
}
|
|
|
|
var r0 domain.Message
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.MessageDraft) (domain.Message, error)); ok {
|
|
return returnFunc(ctx, draft)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.MessageDraft) domain.Message); ok {
|
|
r0 = returnFunc(ctx, draft)
|
|
} else {
|
|
r0 = ret.Get(0).(domain.Message)
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, domain.MessageDraft) error); ok {
|
|
r1 = returnFunc(ctx, draft)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// MockMessageService_Send_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Send'
|
|
type MockMessageService_Send_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Send is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - draft domain.MessageDraft
|
|
func (_e *MockMessageService_Expecter) Send(ctx any, draft any) *MockMessageService_Send_Call {
|
|
return &MockMessageService_Send_Call{Call: _e.mock.On("Send", ctx, draft)}
|
|
}
|
|
|
|
func (_c *MockMessageService_Send_Call) Run(run func(ctx context.Context, draft domain.MessageDraft)) *MockMessageService_Send_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 domain.MessageDraft
|
|
if args[1] != nil {
|
|
arg1 = args[1].(domain.MessageDraft)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMessageService_Send_Call) Return(message domain.Message, err error) *MockMessageService_Send_Call {
|
|
_c.Call.Return(message, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockMessageService_Send_Call) RunAndReturn(run func(ctx context.Context, draft domain.MessageDraft) (domain.Message, error)) *MockMessageService_Send_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|