forked from ebhomengo/niki
209 lines
6.6 KiB
Go
209 lines
6.6 KiB
Go
// Code generated by mockery v2.45.1. DO NOT EDIT.
|
|
|
|
package adminvalidator
|
|
|
|
import (
|
|
context "context"
|
|
|
|
entity "git.gocasts.ir/ebhomengo/niki/entity"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// MockRepository is an autogenerated mock type for the Repository type
|
|
type MockRepository struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type MockRepository_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *MockRepository) EXPECT() *MockRepository_Expecter {
|
|
return &MockRepository_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// AdminExistByEmail provides a mock function with given fields: ctx, email
|
|
func (_m *MockRepository) AdminExistByEmail(ctx context.Context, email string) (bool, error) {
|
|
ret := _m.Called(ctx, email)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for AdminExistByEmail")
|
|
}
|
|
|
|
var r0 bool
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok {
|
|
return rf(ctx, email)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok {
|
|
r0 = rf(ctx, email)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, email)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockRepository_AdminExistByEmail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AdminExistByEmail'
|
|
type MockRepository_AdminExistByEmail_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// AdminExistByEmail is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - email string
|
|
func (_e *MockRepository_Expecter) AdminExistByEmail(ctx interface{}, email interface{}) *MockRepository_AdminExistByEmail_Call {
|
|
return &MockRepository_AdminExistByEmail_Call{Call: _e.mock.On("AdminExistByEmail", ctx, email)}
|
|
}
|
|
|
|
func (_c *MockRepository_AdminExistByEmail_Call) Run(run func(ctx context.Context, email string)) *MockRepository_AdminExistByEmail_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockRepository_AdminExistByEmail_Call) Return(_a0 bool, _a1 error) *MockRepository_AdminExistByEmail_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockRepository_AdminExistByEmail_Call) RunAndReturn(run func(context.Context, string) (bool, error)) *MockRepository_AdminExistByEmail_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// AdminExistByPhoneNumber provides a mock function with given fields: ctx, phoneNumber
|
|
func (_m *MockRepository) AdminExistByPhoneNumber(ctx context.Context, phoneNumber string) (bool, error) {
|
|
ret := _m.Called(ctx, phoneNumber)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for AdminExistByPhoneNumber")
|
|
}
|
|
|
|
var r0 bool
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) (bool, error)); ok {
|
|
return rf(ctx, phoneNumber)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) bool); ok {
|
|
r0 = rf(ctx, phoneNumber)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, phoneNumber)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockRepository_AdminExistByPhoneNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AdminExistByPhoneNumber'
|
|
type MockRepository_AdminExistByPhoneNumber_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// AdminExistByPhoneNumber is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - phoneNumber string
|
|
func (_e *MockRepository_Expecter) AdminExistByPhoneNumber(ctx interface{}, phoneNumber interface{}) *MockRepository_AdminExistByPhoneNumber_Call {
|
|
return &MockRepository_AdminExistByPhoneNumber_Call{Call: _e.mock.On("AdminExistByPhoneNumber", ctx, phoneNumber)}
|
|
}
|
|
|
|
func (_c *MockRepository_AdminExistByPhoneNumber_Call) Run(run func(ctx context.Context, phoneNumber string)) *MockRepository_AdminExistByPhoneNumber_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockRepository_AdminExistByPhoneNumber_Call) Return(_a0 bool, _a1 error) *MockRepository_AdminExistByPhoneNumber_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockRepository_AdminExistByPhoneNumber_Call) RunAndReturn(run func(context.Context, string) (bool, error)) *MockRepository_AdminExistByPhoneNumber_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetAdminByPhoneNumber provides a mock function with given fields: ctx, phoneNumber
|
|
func (_m *MockRepository) GetAdminByPhoneNumber(ctx context.Context, phoneNumber string) (entity.Admin, error) {
|
|
ret := _m.Called(ctx, phoneNumber)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetAdminByPhoneNumber")
|
|
}
|
|
|
|
var r0 entity.Admin
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) (entity.Admin, error)); ok {
|
|
return rf(ctx, phoneNumber)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) entity.Admin); ok {
|
|
r0 = rf(ctx, phoneNumber)
|
|
} else {
|
|
r0 = ret.Get(0).(entity.Admin)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, phoneNumber)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// MockRepository_GetAdminByPhoneNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAdminByPhoneNumber'
|
|
type MockRepository_GetAdminByPhoneNumber_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetAdminByPhoneNumber is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - phoneNumber string
|
|
func (_e *MockRepository_Expecter) GetAdminByPhoneNumber(ctx interface{}, phoneNumber interface{}) *MockRepository_GetAdminByPhoneNumber_Call {
|
|
return &MockRepository_GetAdminByPhoneNumber_Call{Call: _e.mock.On("GetAdminByPhoneNumber", ctx, phoneNumber)}
|
|
}
|
|
|
|
func (_c *MockRepository_GetAdminByPhoneNumber_Call) Run(run func(ctx context.Context, phoneNumber string)) *MockRepository_GetAdminByPhoneNumber_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockRepository_GetAdminByPhoneNumber_Call) Return(_a0 entity.Admin, _a1 error) *MockRepository_GetAdminByPhoneNumber_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockRepository_GetAdminByPhoneNumber_Call) RunAndReturn(run func(context.Context, string) (entity.Admin, error)) *MockRepository_GetAdminByPhoneNumber_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// NewMockRepository creates a new instance of MockRepository. 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 NewMockRepository(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockRepository {
|
|
mock := &MockRepository{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|