mocks

package
v0.0.0-...-9a37cb8 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisMock

type RedisMock struct {
	DelMock mRedisMockDel

	GetMock mRedisMockGet

	IncrMock mRedisMockIncr

	SetMock mRedisMockSet
	// contains filtered or unexported fields
}

RedisMock implements IRedis

func NewRedisMock

func NewRedisMock(t minimock.Tester) *RedisMock

NewRedisMock returns a mock for IRedis

func (*RedisMock) Del

func (mmDel *RedisMock) Del(ctx context.Context, keys ...string) (ip1 *redis.IntCmd)

Del implements IRedis

func (*RedisMock) DelAfterCounter

func (mmDel *RedisMock) DelAfterCounter() uint64

DelAfterCounter returns a count of finished RedisMock.Del invocations

func (*RedisMock) DelBeforeCounter

func (mmDel *RedisMock) DelBeforeCounter() uint64

DelBeforeCounter returns a count of RedisMock.Del invocations

func (*RedisMock) Get

func (mmGet *RedisMock) Get(ctx context.Context, key string) (sp1 *redis.StringCmd)

Get implements IRedis

func (*RedisMock) GetAfterCounter

func (mmGet *RedisMock) GetAfterCounter() uint64

GetAfterCounter returns a count of finished RedisMock.Get invocations

func (*RedisMock) GetBeforeCounter

func (mmGet *RedisMock) GetBeforeCounter() uint64

GetBeforeCounter returns a count of RedisMock.Get invocations

func (*RedisMock) Incr

func (mmIncr *RedisMock) Incr(ctx context.Context, key string) (ip1 *redis.IntCmd)

Incr implements IRedis

func (*RedisMock) IncrAfterCounter

func (mmIncr *RedisMock) IncrAfterCounter() uint64

IncrAfterCounter returns a count of finished RedisMock.Incr invocations

func (*RedisMock) IncrBeforeCounter

func (mmIncr *RedisMock) IncrBeforeCounter() uint64

IncrBeforeCounter returns a count of RedisMock.Incr invocations

func (*RedisMock) MinimockDelDone

func (m *RedisMock) MinimockDelDone() bool

MinimockDelDone returns true if the count of the Del invocations corresponds the number of defined expectations

func (*RedisMock) MinimockDelInspect

func (m *RedisMock) MinimockDelInspect()

MinimockDelInspect logs each unmet expectation

func (*RedisMock) MinimockFinish

func (m *RedisMock) MinimockFinish()

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

func (*RedisMock) MinimockGetDone

func (m *RedisMock) MinimockGetDone() bool

MinimockGetDone returns true if the count of the Get invocations corresponds the number of defined expectations

func (*RedisMock) MinimockGetInspect

func (m *RedisMock) MinimockGetInspect()

MinimockGetInspect logs each unmet expectation

func (*RedisMock) MinimockIncrDone

func (m *RedisMock) MinimockIncrDone() bool

MinimockIncrDone returns true if the count of the Incr invocations corresponds the number of defined expectations

func (*RedisMock) MinimockIncrInspect

func (m *RedisMock) MinimockIncrInspect()

MinimockIncrInspect logs each unmet expectation

func (*RedisMock) MinimockSetDone

func (m *RedisMock) MinimockSetDone() bool

MinimockSetDone returns true if the count of the Set invocations corresponds the number of defined expectations

func (*RedisMock) MinimockSetInspect

func (m *RedisMock) MinimockSetInspect()

MinimockSetInspect logs each unmet expectation

func (*RedisMock) MinimockWait

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

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

func (*RedisMock) Set

func (mmSet *RedisMock) Set(ctx context.Context, key string, value interface{}) (sp1 *redis.StatusCmd)

Set implements IRedis

func (*RedisMock) SetAfterCounter

func (mmSet *RedisMock) SetAfterCounter() uint64

SetAfterCounter returns a count of finished RedisMock.Set invocations

func (*RedisMock) SetBeforeCounter

func (mmSet *RedisMock) SetBeforeCounter() uint64

SetBeforeCounter returns a count of RedisMock.Set invocations

type RedisMockDelExpectation

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

RedisMockDelExpectation specifies expectation struct of the IRedis.Del

func (*RedisMockDelExpectation) Then

func (e *RedisMockDelExpectation) Then(ip1 *redis.IntCmd) *RedisMock

Then sets up IRedis.Del return parameters for the expectation previously defined by the When method

type RedisMockDelParams

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

RedisMockDelParams contains parameters of the IRedis.Del

type RedisMockDelResults

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

RedisMockDelResults contains results of the IRedis.Del

type RedisMockGetExpectation

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

RedisMockGetExpectation specifies expectation struct of the IRedis.Get

func (*RedisMockGetExpectation) Then

func (e *RedisMockGetExpectation) Then(sp1 *redis.StringCmd) *RedisMock

Then sets up IRedis.Get return parameters for the expectation previously defined by the When method

type RedisMockGetParams

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

RedisMockGetParams contains parameters of the IRedis.Get

type RedisMockGetResults

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

RedisMockGetResults contains results of the IRedis.Get

type RedisMockIncrExpectation

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

RedisMockIncrExpectation specifies expectation struct of the IRedis.Incr

func (*RedisMockIncrExpectation) Then

func (e *RedisMockIncrExpectation) Then(ip1 *redis.IntCmd) *RedisMock

Then sets up IRedis.Incr return parameters for the expectation previously defined by the When method

type RedisMockIncrParams

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

RedisMockIncrParams contains parameters of the IRedis.Incr

type RedisMockIncrResults

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

RedisMockIncrResults contains results of the IRedis.Incr

type RedisMockSetExpectation

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

RedisMockSetExpectation specifies expectation struct of the IRedis.Set

func (*RedisMockSetExpectation) Then

func (e *RedisMockSetExpectation) Then(sp1 *redis.StatusCmd) *RedisMock

Then sets up IRedis.Set return parameters for the expectation previously defined by the When method

type RedisMockSetParams

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

RedisMockSetParams contains parameters of the IRedis.Set

type RedisMockSetResults

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

RedisMockSetResults contains results of the IRedis.Set

Jump to

Keyboard shortcuts

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