generated from PenaSide/GolangTemplate
148 lines
4.2 KiB
Go
148 lines
4.2 KiB
Go
// Code generated by mockery v2.26.0. DO NOT EDIT.
|
|
|
|
package mocks
|
|
|
|
import (
|
|
context "context"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
models "penahub.gitlab.yandexcloud.net/pena-services/pena-social-auth/internal/models"
|
|
)
|
|
|
|
// AmocrmService is an autogenerated mock type for the amocrmService type
|
|
type AmocrmService struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type AmocrmService_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *AmocrmService) EXPECT() *AmocrmService_Expecter {
|
|
return &AmocrmService_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// Auth provides a mock function with given fields: ctx, code
|
|
func (_m *AmocrmService) Auth(ctx context.Context, code string) (*models.Tokens, error) {
|
|
ret := _m.Called(ctx, code)
|
|
|
|
var r0 *models.Tokens
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) (*models.Tokens, error)); ok {
|
|
return rf(ctx, code)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) *models.Tokens); ok {
|
|
r0 = rf(ctx, code)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*models.Tokens)
|
|
}
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, code)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// AmocrmService_Auth_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Auth'
|
|
type AmocrmService_Auth_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Auth is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - code string
|
|
func (_e *AmocrmService_Expecter) Auth(ctx interface{}, code interface{}) *AmocrmService_Auth_Call {
|
|
return &AmocrmService_Auth_Call{Call: _e.mock.On("Auth", ctx, code)}
|
|
}
|
|
|
|
func (_c *AmocrmService_Auth_Call) Run(run func(ctx context.Context, code string)) *AmocrmService_Auth_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *AmocrmService_Auth_Call) Return(_a0 *models.Tokens, _a1 error) *AmocrmService_Auth_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *AmocrmService_Auth_Call) RunAndReturn(run func(context.Context, string) (*models.Tokens, error)) *AmocrmService_Auth_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// Link provides a mock function with given fields: ctx, code, accessToken
|
|
func (_m *AmocrmService) Link(ctx context.Context, code string, accessToken string) (bool, error) {
|
|
ret := _m.Called(ctx, code, accessToken)
|
|
|
|
var r0 bool
|
|
var r1 error
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string) (bool, error)); ok {
|
|
return rf(ctx, code, accessToken)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(context.Context, string, string) bool); ok {
|
|
r0 = rf(ctx, code, accessToken)
|
|
} else {
|
|
r0 = ret.Get(0).(bool)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
|
|
r1 = rf(ctx, code, accessToken)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// AmocrmService_Link_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Link'
|
|
type AmocrmService_Link_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Link is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - code string
|
|
// - accessToken string
|
|
func (_e *AmocrmService_Expecter) Link(ctx interface{}, code interface{}, accessToken interface{}) *AmocrmService_Link_Call {
|
|
return &AmocrmService_Link_Call{Call: _e.mock.On("Link", ctx, code, accessToken)}
|
|
}
|
|
|
|
func (_c *AmocrmService_Link_Call) Run(run func(ctx context.Context, code string, accessToken string)) *AmocrmService_Link_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(context.Context), args[1].(string), args[2].(string))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *AmocrmService_Link_Call) Return(_a0 bool, _a1 error) *AmocrmService_Link_Call {
|
|
_c.Call.Return(_a0, _a1)
|
|
return _c
|
|
}
|
|
|
|
func (_c *AmocrmService_Link_Call) RunAndReturn(run func(context.Context, string, string) (bool, error)) *AmocrmService_Link_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
type mockConstructorTestingTNewAmocrmService interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}
|
|
|
|
// NewAmocrmService creates a new instance of AmocrmService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
func NewAmocrmService(t mockConstructorTestingTNewAmocrmService) *AmocrmService {
|
|
mock := &AmocrmService{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|