mocks

package
v0.0.0-...-5f682be Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TransactorMock

type TransactorMock struct {
	BeginTxMock mTransactorMockBeginTx
	// contains filtered or unexported fields
}

TransactorMock implements db.Transactor

func NewTransactorMock

func NewTransactorMock(t minimock.Tester) *TransactorMock

NewTransactorMock returns a mock for db.Transactor

func (*TransactorMock) BeginTx

func (mmBeginTx *TransactorMock) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (t1 pgx.Tx, err error)

BeginTx implements db.Transactor

func (*TransactorMock) BeginTxAfterCounter

func (mmBeginTx *TransactorMock) BeginTxAfterCounter() uint64

BeginTxAfterCounter returns a count of finished TransactorMock.BeginTx invocations

func (*TransactorMock) BeginTxBeforeCounter

func (mmBeginTx *TransactorMock) BeginTxBeforeCounter() uint64

BeginTxBeforeCounter returns a count of TransactorMock.BeginTx invocations

func (*TransactorMock) MinimockBeginTxDone

func (m *TransactorMock) MinimockBeginTxDone() bool

MinimockBeginTxDone returns true if the count of the BeginTx invocations corresponds the number of defined expectations

func (*TransactorMock) MinimockBeginTxInspect

func (m *TransactorMock) MinimockBeginTxInspect()

MinimockBeginTxInspect logs each unmet expectation

func (*TransactorMock) MinimockFinish

func (m *TransactorMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*TransactorMock) MinimockWait

func (m *TransactorMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

type TransactorMockBeginTxExpectation

type TransactorMockBeginTxExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

TransactorMockBeginTxExpectation specifies expectation struct of the Transactor.BeginTx

func (*TransactorMockBeginTxExpectation) Then

func (e *TransactorMockBeginTxExpectation) Then(t1 pgx.Tx, err error) *TransactorMock

Then sets up Transactor.BeginTx return parameters for the expectation previously defined by the When method

type TransactorMockBeginTxParams

type TransactorMockBeginTxParams struct {
	// contains filtered or unexported fields
}

TransactorMockBeginTxParams contains parameters of the Transactor.BeginTx

type TransactorMockBeginTxResults

type TransactorMockBeginTxResults struct {
	// contains filtered or unexported fields
}

TransactorMockBeginTxResults contains results of the Transactor.BeginTx

type TxManagerMock

type TxManagerMock struct {
	ReadCommittedMock mTxManagerMockReadCommitted
	// contains filtered or unexported fields
}

TxManagerMock implements db.TxManager

func NewTxManagerMock

func NewTxManagerMock(t minimock.Tester) *TxManagerMock

NewTxManagerMock returns a mock for db.TxManager

func (*TxManagerMock) MinimockFinish

func (m *TxManagerMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*TxManagerMock) MinimockReadCommittedDone

func (m *TxManagerMock) MinimockReadCommittedDone() bool

MinimockReadCommittedDone returns true if the count of the ReadCommitted invocations corresponds the number of defined expectations

func (*TxManagerMock) MinimockReadCommittedInspect

func (m *TxManagerMock) MinimockReadCommittedInspect()

MinimockReadCommittedInspect logs each unmet expectation

func (*TxManagerMock) MinimockWait

func (m *TxManagerMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*TxManagerMock) ReadCommitted

func (mmReadCommitted *TxManagerMock) ReadCommitted(ctx context.Context, f mm_db.Handler) (err error)

ReadCommitted implements db.TxManager

func (*TxManagerMock) ReadCommittedAfterCounter

func (mmReadCommitted *TxManagerMock) ReadCommittedAfterCounter() uint64

ReadCommittedAfterCounter returns a count of finished TxManagerMock.ReadCommitted invocations

func (*TxManagerMock) ReadCommittedBeforeCounter

func (mmReadCommitted *TxManagerMock) ReadCommittedBeforeCounter() uint64

ReadCommittedBeforeCounter returns a count of TxManagerMock.ReadCommitted invocations

type TxManagerMockReadCommittedExpectation

type TxManagerMockReadCommittedExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

TxManagerMockReadCommittedExpectation specifies expectation struct of the TxManager.ReadCommitted

func (*TxManagerMockReadCommittedExpectation) Then

Then sets up TxManager.ReadCommitted return parameters for the expectation previously defined by the When method

type TxManagerMockReadCommittedParams

type TxManagerMockReadCommittedParams struct {
	// contains filtered or unexported fields
}

TxManagerMockReadCommittedParams contains parameters of the TxManager.ReadCommitted

type TxManagerMockReadCommittedResults

type TxManagerMockReadCommittedResults struct {
	// contains filtered or unexported fields
}

TxManagerMockReadCommittedResults contains results of the TxManager.ReadCommitted

Jump to

Keyboard shortcuts

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