Documentation ¶
Index ¶
- func IsDomainError(err error) bool
- type Repository
- type RepositoryMock
- func (mock *RepositoryMock) ListTransfersByAccountID(contextMoqParam context.Context, s string) ([]entities.Transfer, error)
- func (mock *RepositoryMock) ListTransfersByAccountIDCalls() []struct{ ... }
- func (mock *RepositoryMock) PerformTransference(contextMoqParam context.Context, ...) error
- func (mock *RepositoryMock) PerformTransferenceCalls() []struct{ ... }
- type UseCase
- type UseCaseMock
- func (mock *UseCaseMock) List(ctx context.Context, origID string) ([]entities.Transfer, error)
- func (mock *UseCaseMock) ListCalls() []struct{ ... }
- func (mock *UseCaseMock) Perform(contextMoqParam context.Context, ...) (*entities.Transfer, error)
- func (mock *UseCaseMock) PerformCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDomainError ¶
Check if some error belongs to the transfer domain
Types ¶
type Repository ¶
type RepositoryMock ¶
type RepositoryMock struct { // ListTransfersByAccountIDFunc mocks the ListTransfersByAccountID method. ListTransfersByAccountIDFunc func(contextMoqParam context.Context, s string) ([]entities.Transfer, error) // PerformTransferenceFunc mocks the PerformTransference method. PerformTransferenceFunc func(contextMoqParam context.Context, performTransferenceInput entities.PerformTransferenceInput) error // contains filtered or unexported fields }
RepositoryMock is a mock implementation of Repository.
func TestSomethingThatUsesRepository(t *testing.T) { // make and configure a mocked Repository mockedRepository := &RepositoryMock{ ListTransfersByAccountIDFunc: func(contextMoqParam context.Context, s string) ([]entities.Transfer, error) { panic("mock out the ListTransfersByAccountID method") }, PerformTransferenceFunc: func(contextMoqParam context.Context, performTransferenceInput entities.PerformTransferenceInput) error { panic("mock out the PerformTransference method") }, } // use mockedRepository in code that requires Repository // and then make assertions. }
func (*RepositoryMock) ListTransfersByAccountID ¶
func (mock *RepositoryMock) ListTransfersByAccountID(contextMoqParam context.Context, s string) ([]entities.Transfer, error)
ListTransfersByAccountID calls ListTransfersByAccountIDFunc.
func (*RepositoryMock) ListTransfersByAccountIDCalls ¶
func (mock *RepositoryMock) ListTransfersByAccountIDCalls() []struct { ContextMoqParam context.Context S string }
ListTransfersByAccountIDCalls gets all the calls that were made to ListTransfersByAccountID. Check the length with:
len(mockedRepository.ListTransfersByAccountIDCalls())
func (*RepositoryMock) PerformTransference ¶
func (mock *RepositoryMock) PerformTransference(contextMoqParam context.Context, performTransferenceInput entities.PerformTransferenceInput) error
PerformTransference calls PerformTransferenceFunc.
func (*RepositoryMock) PerformTransferenceCalls ¶
func (mock *RepositoryMock) PerformTransferenceCalls() []struct { ContextMoqParam context.Context PerformTransferenceInput entities.PerformTransferenceInput }
PerformTransferenceCalls gets all the calls that were made to PerformTransference. Check the length with:
len(mockedRepository.PerformTransferenceCalls())
type UseCaseMock ¶
type UseCaseMock struct { // ListFunc mocks the List method. ListFunc func(ctx context.Context, origID string) ([]entities.Transfer, error) // PerformFunc mocks the Perform method. PerformFunc func(contextMoqParam context.Context, createTransferInput entities.CreateTransferInput) (*entities.Transfer, error) // contains filtered or unexported fields }
UseCaseMock is a mock implementation of UseCase.
func TestSomethingThatUsesUseCase(t *testing.T) { // make and configure a mocked UseCase mockedUseCase := &UseCaseMock{ ListFunc: func(ctx context.Context, origID string) ([]entities.Transfer, error) { panic("mock out the List method") }, PerformFunc: func(contextMoqParam context.Context, createTransferInput entities.CreateTransferInput) (*entities.Transfer, error) { panic("mock out the Perform method") }, } // use mockedUseCase in code that requires UseCase // and then make assertions. }
func (*UseCaseMock) ListCalls ¶
func (mock *UseCaseMock) ListCalls() []struct { Ctx context.Context OrigID string }
ListCalls gets all the calls that were made to List. Check the length with:
len(mockedUseCase.ListCalls())
func (*UseCaseMock) Perform ¶
func (mock *UseCaseMock) Perform(contextMoqParam context.Context, createTransferInput entities.CreateTransferInput) (*entities.Transfer, error)
Perform calls PerformFunc.
func (*UseCaseMock) PerformCalls ¶
func (mock *UseCaseMock) PerformCalls() []struct { ContextMoqParam context.Context CreateTransferInput entities.CreateTransferInput }
PerformCalls gets all the calls that were made to Perform. Check the length with:
len(mockedUseCase.PerformCalls())