moq

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TransactionsStorageMock

type TransactionsStorageMock struct {
	// GetLastTransactionDateFunc mocks the GetLastTransactionDate method.
	GetLastTransactionDateFunc func(ctx context.Context, accountID string) (time.Time, error)
	// contains filtered or unexported fields
}

TransactionsStorageMock is a mock implementation of TransactionsStorage.

    func TestSomethingThatUsesTransactionsStorage(t *testing.T) {

        // make and configure a mocked TransactionsStorage
        mockedTransactionsStorage := &TransactionsStorageMock{
            GetLastTransactionDateFunc: func(ctx context.Context, accountID string) (time.Time, error) {
	               panic("mock out the GetLastTransactionDate method")
            },
        }

        // use mockedTransactionsStorage in code that requires TransactionsStorage
        // and then make assertions.

    }

func (*TransactionsStorageMock) GetLastTransactionDate

func (mock *TransactionsStorageMock) GetLastTransactionDate(ctx context.Context, accountID string) (time.Time, error)

GetLastTransactionDate calls GetLastTransactionDateFunc.

func (*TransactionsStorageMock) GetLastTransactionDateCalls

func (mock *TransactionsStorageMock) GetLastTransactionDateCalls() []struct {
	Ctx       context.Context
	AccountID string
}

GetLastTransactionDateCalls gets all the calls that were made to GetLastTransactionDate. Check the length with:

len(mockedTransactionsStorage.GetLastTransactionDateCalls())

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL