332 lines
9.6 KiB
Go
332 lines
9.6 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"
|
|
)
|
|
|
|
// NewMockChatSource creates a new instance of MockChatSource. 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 NewMockChatSource(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockChatSource {
|
|
if helper, ok := t.(interface{ Helper() }); ok {
|
|
helper.Helper()
|
|
}
|
|
|
|
mock := &MockChatSource{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() {
|
|
if helper, ok := t.(interface{ Helper() }); ok {
|
|
helper.Helper()
|
|
}
|
|
mock.AssertExpectations(t)
|
|
})
|
|
|
|
return mock
|
|
}
|
|
|
|
// MockChatSource is an autogenerated mock type for the ChatSource type
|
|
type MockChatSource struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type MockChatSource_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *MockChatSource) EXPECT() *MockChatSource_Expecter {
|
|
return &MockChatSource_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// Create provides a mock function for the type MockChatSource
|
|
func (_mock *MockChatSource) Create(ctx context.Context, draft domain.ChatDraft) (domain.Chat, error) {
|
|
ret := _mock.Called(ctx, draft)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for Create")
|
|
}
|
|
|
|
var r0 domain.Chat
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.ChatDraft) (domain.Chat, error)); ok {
|
|
return returnFunc(ctx, draft)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, domain.ChatDraft) domain.Chat); ok {
|
|
r0 = returnFunc(ctx, draft)
|
|
} else {
|
|
r0 = ret.Get(0).(domain.Chat)
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, domain.ChatDraft) error); ok {
|
|
r1 = returnFunc(ctx, draft)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// MockChatSource_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
|
|
type MockChatSource_Create_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Create is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - draft domain.ChatDraft
|
|
func (_e *MockChatSource_Expecter) Create(ctx any, draft any) *MockChatSource_Create_Call {
|
|
return &MockChatSource_Create_Call{Call: _e.mock.On("Create", ctx, draft)}
|
|
}
|
|
|
|
func (_c *MockChatSource_Create_Call) Run(run func(ctx context.Context, draft domain.ChatDraft)) *MockChatSource_Create_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 domain.ChatDraft
|
|
if args[1] != nil {
|
|
arg1 = args[1].(domain.ChatDraft)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockChatSource_Create_Call) Return(chat domain.Chat, err error) *MockChatSource_Create_Call {
|
|
_c.Call.Return(chat, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockChatSource_Create_Call) RunAndReturn(run func(ctx context.Context, draft domain.ChatDraft) (domain.Chat, error)) *MockChatSource_Create_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetVisible provides a mock function for the type MockChatSource
|
|
func (_mock *MockChatSource) GetVisible(ctx context.Context, chatID uuid.UUID, callerID uuid.UUID) (domain.Chat, error) {
|
|
ret := _mock.Called(ctx, chatID, callerID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetVisible")
|
|
}
|
|
|
|
var r0 domain.Chat
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, uuid.UUID, uuid.UUID) (domain.Chat, error)); ok {
|
|
return returnFunc(ctx, chatID, callerID)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, uuid.UUID, uuid.UUID) domain.Chat); ok {
|
|
r0 = returnFunc(ctx, chatID, callerID)
|
|
} else {
|
|
r0 = ret.Get(0).(domain.Chat)
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, uuid.UUID, uuid.UUID) error); ok {
|
|
r1 = returnFunc(ctx, chatID, callerID)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// MockChatSource_GetVisible_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVisible'
|
|
type MockChatSource_GetVisible_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetVisible is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - chatID uuid.UUID
|
|
// - callerID uuid.UUID
|
|
func (_e *MockChatSource_Expecter) GetVisible(ctx any, chatID any, callerID any) *MockChatSource_GetVisible_Call {
|
|
return &MockChatSource_GetVisible_Call{Call: _e.mock.On("GetVisible", ctx, chatID, callerID)}
|
|
}
|
|
|
|
func (_c *MockChatSource_GetVisible_Call) Run(run func(ctx context.Context, chatID uuid.UUID, callerID uuid.UUID)) *MockChatSource_GetVisible_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)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
arg2,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockChatSource_GetVisible_Call) Return(chat domain.Chat, err error) *MockChatSource_GetVisible_Call {
|
|
_c.Call.Return(chat, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockChatSource_GetVisible_Call) RunAndReturn(run func(ctx context.Context, chatID uuid.UUID, callerID uuid.UUID) (domain.Chat, error)) *MockChatSource_GetVisible_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// ListVersion provides a mock function for the type MockChatSource
|
|
func (_mock *MockChatSource) ListVersion(ctx context.Context, userID uuid.UUID) (int64, error) {
|
|
ret := _mock.Called(ctx, userID)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ListVersion")
|
|
}
|
|
|
|
var r0 int64
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, uuid.UUID) (int64, error)); ok {
|
|
return returnFunc(ctx, userID)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, uuid.UUID) int64); ok {
|
|
r0 = returnFunc(ctx, userID)
|
|
} else {
|
|
r0 = ret.Get(0).(int64)
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, uuid.UUID) error); ok {
|
|
r1 = returnFunc(ctx, userID)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// MockChatSource_ListVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListVersion'
|
|
type MockChatSource_ListVersion_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// ListVersion is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - userID uuid.UUID
|
|
func (_e *MockChatSource_Expecter) ListVersion(ctx any, userID any) *MockChatSource_ListVersion_Call {
|
|
return &MockChatSource_ListVersion_Call{Call: _e.mock.On("ListVersion", ctx, userID)}
|
|
}
|
|
|
|
func (_c *MockChatSource_ListVersion_Call) Run(run func(ctx context.Context, userID uuid.UUID)) *MockChatSource_ListVersion_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)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockChatSource_ListVersion_Call) Return(n int64, err error) *MockChatSource_ListVersion_Call {
|
|
_c.Call.Return(n, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockChatSource_ListVersion_Call) RunAndReturn(run func(ctx context.Context, userID uuid.UUID) (int64, error)) *MockChatSource_ListVersion_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// ListVisible provides a mock function for the type MockChatSource
|
|
func (_mock *MockChatSource) ListVisible(ctx context.Context, callerID uuid.UUID, after *domain.Cursor, limit int) (domain.Page[domain.Chat], error) {
|
|
ret := _mock.Called(ctx, callerID, after, limit)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for ListVisible")
|
|
}
|
|
|
|
var r0 domain.Page[domain.Chat]
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, uuid.UUID, *domain.Cursor, int) (domain.Page[domain.Chat], error)); ok {
|
|
return returnFunc(ctx, callerID, after, limit)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, uuid.UUID, *domain.Cursor, int) domain.Page[domain.Chat]); ok {
|
|
r0 = returnFunc(ctx, callerID, after, limit)
|
|
} else {
|
|
r0 = ret.Get(0).(domain.Page[domain.Chat])
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, uuid.UUID, *domain.Cursor, int) error); ok {
|
|
r1 = returnFunc(ctx, callerID, after, limit)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// MockChatSource_ListVisible_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListVisible'
|
|
type MockChatSource_ListVisible_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// ListVisible is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - callerID uuid.UUID
|
|
// - after *domain.Cursor
|
|
// - limit int
|
|
func (_e *MockChatSource_Expecter) ListVisible(ctx any, callerID any, after any, limit any) *MockChatSource_ListVisible_Call {
|
|
return &MockChatSource_ListVisible_Call{Call: _e.mock.On("ListVisible", ctx, callerID, after, limit)}
|
|
}
|
|
|
|
func (_c *MockChatSource_ListVisible_Call) Run(run func(ctx context.Context, callerID uuid.UUID, after *domain.Cursor, limit int)) *MockChatSource_ListVisible_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 *domain.Cursor
|
|
if args[2] != nil {
|
|
arg2 = args[2].(*domain.Cursor)
|
|
}
|
|
var arg3 int
|
|
if args[3] != nil {
|
|
arg3 = args[3].(int)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
arg2,
|
|
arg3,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockChatSource_ListVisible_Call) Return(page domain.Page[domain.Chat], err error) *MockChatSource_ListVisible_Call {
|
|
_c.Call.Return(page, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockChatSource_ListVisible_Call) RunAndReturn(run func(ctx context.Context, callerID uuid.UUID, after *domain.Cursor, limit int) (domain.Page[domain.Chat], error)) *MockChatSource_ListVisible_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|