mock

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockableAssetMock added in v1.1.0

type LockableAssetMock struct {
	// GetAssetFunc mocks the GetAsset method.
	GetAssetFunc func() types.Coin

	// GetCoinFunc mocks the GetCoin method.
	GetCoinFunc func(ctx types.Context) types.Coin

	// LockFromFunc mocks the LockFrom method.
	LockFromFunc func(ctx types.Context, fromAddr types.AccAddress) error

	// UnlockToFunc mocks the UnlockTo method.
	UnlockToFunc func(ctx types.Context, toAddr types.AccAddress) error
	// contains filtered or unexported fields
}

LockableAssetMock is a mock implementation of exported.LockableAsset.

func TestSomethingThatUsesLockableAsset(t *testing.T) {

	// make and configure a mocked exported.LockableAsset
	mockedLockableAsset := &LockableAssetMock{
		GetAssetFunc: func() types.Coin {
			panic("mock out the GetAsset method")
		},
		GetCoinFunc: func(ctx types.Context) types.Coin {
			panic("mock out the GetCoin method")
		},
		LockFromFunc: func(ctx types.Context, fromAddr types.AccAddress) error {
			panic("mock out the LockFrom method")
		},
		UnlockToFunc: func(ctx types.Context, toAddr types.AccAddress) error {
			panic("mock out the UnlockTo method")
		},
	}

	// use mockedLockableAsset in code that requires exported.LockableAsset
	// and then make assertions.

}

func (*LockableAssetMock) GetAsset added in v1.1.0

func (mock *LockableAssetMock) GetAsset() types.Coin

GetAsset calls GetAssetFunc.

func (*LockableAssetMock) GetAssetCalls added in v1.1.0

func (mock *LockableAssetMock) GetAssetCalls() []struct {
}

GetAssetCalls gets all the calls that were made to GetAsset. Check the length with:

len(mockedLockableAsset.GetAssetCalls())

func (*LockableAssetMock) GetCoin added in v1.1.0

func (mock *LockableAssetMock) GetCoin(ctx types.Context) types.Coin

GetCoin calls GetCoinFunc.

func (*LockableAssetMock) GetCoinCalls added in v1.1.0

func (mock *LockableAssetMock) GetCoinCalls() []struct {
	Ctx types.Context
}

GetCoinCalls gets all the calls that were made to GetCoin. Check the length with:

len(mockedLockableAsset.GetCoinCalls())

func (*LockableAssetMock) LockFrom added in v1.1.0

func (mock *LockableAssetMock) LockFrom(ctx types.Context, fromAddr types.AccAddress) error

LockFrom calls LockFromFunc.

func (*LockableAssetMock) LockFromCalls added in v1.1.0

func (mock *LockableAssetMock) LockFromCalls() []struct {
	Ctx      types.Context
	FromAddr types.AccAddress
}

LockFromCalls gets all the calls that were made to LockFrom. Check the length with:

len(mockedLockableAsset.LockFromCalls())

func (*LockableAssetMock) UnlockTo added in v1.1.0

func (mock *LockableAssetMock) UnlockTo(ctx types.Context, toAddr types.AccAddress) error

UnlockTo calls UnlockToFunc.

func (*LockableAssetMock) UnlockToCalls added in v1.1.0

func (mock *LockableAssetMock) UnlockToCalls() []struct {
	Ctx    types.Context
	ToAddr types.AccAddress
}

UnlockToCalls gets all the calls that were made to UnlockTo. Check the length with:

len(mockedLockableAsset.UnlockToCalls())

type MaintainerStateMock

type MaintainerStateMock struct {
	// CountIncorrectVotesFunc mocks the CountIncorrectVotes method.
	CountIncorrectVotesFunc func(window int) uint64

	// CountMissingVotesFunc mocks the CountMissingVotes method.
	CountMissingVotesFunc func(window int) uint64

	// GetAddressFunc mocks the GetAddress method.
	GetAddressFunc func() types.ValAddress

	// MarkIncorrectVoteFunc mocks the MarkIncorrectVote method.
	MarkIncorrectVoteFunc func(incorrectVote bool)

	// MarkMissingVoteFunc mocks the MarkMissingVote method.
	MarkMissingVoteFunc func(missingVote bool)

	// MarshalFunc mocks the Marshal method.
	MarshalFunc func() ([]byte, error)

	// MarshalToFunc mocks the MarshalTo method.
	MarshalToFunc func(data []byte) (int, error)

	// MarshalToSizedBufferFunc mocks the MarshalToSizedBuffer method.
	MarshalToSizedBufferFunc func(dAtA []byte) (int, error)

	// ProtoMessageFunc mocks the ProtoMessage method.
	ProtoMessageFunc func()

	// ResetFunc mocks the Reset method.
	ResetFunc func()

	// SizeFunc mocks the Size method.
	SizeFunc func() int

	// StringFunc mocks the String method.
	StringFunc func() string

	// UnmarshalFunc mocks the Unmarshal method.
	UnmarshalFunc func(data []byte) error
	// contains filtered or unexported fields
}

MaintainerStateMock is a mock implementation of exported.MaintainerState.

func TestSomethingThatUsesMaintainerState(t *testing.T) {

	// make and configure a mocked exported.MaintainerState
	mockedMaintainerState := &MaintainerStateMock{
		CountIncorrectVotesFunc: func(window int) uint64 {
			panic("mock out the CountIncorrectVotes method")
		},
		CountMissingVotesFunc: func(window int) uint64 {
			panic("mock out the CountMissingVotes method")
		},
		GetAddressFunc: func() types.ValAddress {
			panic("mock out the GetAddress method")
		},
		MarkIncorrectVoteFunc: func(incorrectVote bool)  {
			panic("mock out the MarkIncorrectVote method")
		},
		MarkMissingVoteFunc: func(missingVote bool)  {
			panic("mock out the MarkMissingVote method")
		},
		MarshalFunc: func() ([]byte, error) {
			panic("mock out the Marshal method")
		},
		MarshalToFunc: func(data []byte) (int, error) {
			panic("mock out the MarshalTo method")
		},
		MarshalToSizedBufferFunc: func(dAtA []byte) (int, error) {
			panic("mock out the MarshalToSizedBuffer method")
		},
		ProtoMessageFunc: func()  {
			panic("mock out the ProtoMessage method")
		},
		ResetFunc: func()  {
			panic("mock out the Reset method")
		},
		SizeFunc: func() int {
			panic("mock out the Size method")
		},
		StringFunc: func() string {
			panic("mock out the String method")
		},
		UnmarshalFunc: func(data []byte) error {
			panic("mock out the Unmarshal method")
		},
	}

	// use mockedMaintainerState in code that requires exported.MaintainerState
	// and then make assertions.

}

func (*MaintainerStateMock) CountIncorrectVotes

func (mock *MaintainerStateMock) CountIncorrectVotes(window int) uint64

CountIncorrectVotes calls CountIncorrectVotesFunc.

func (*MaintainerStateMock) CountIncorrectVotesCalls

func (mock *MaintainerStateMock) CountIncorrectVotesCalls() []struct {
	Window int
}

CountIncorrectVotesCalls gets all the calls that were made to CountIncorrectVotes. Check the length with:

len(mockedMaintainerState.CountIncorrectVotesCalls())

func (*MaintainerStateMock) CountMissingVotes

func (mock *MaintainerStateMock) CountMissingVotes(window int) uint64

CountMissingVotes calls CountMissingVotesFunc.

func (*MaintainerStateMock) CountMissingVotesCalls

func (mock *MaintainerStateMock) CountMissingVotesCalls() []struct {
	Window int
}

CountMissingVotesCalls gets all the calls that were made to CountMissingVotes. Check the length with:

len(mockedMaintainerState.CountMissingVotesCalls())

func (*MaintainerStateMock) GetAddress

func (mock *MaintainerStateMock) GetAddress() types.ValAddress

GetAddress calls GetAddressFunc.

func (*MaintainerStateMock) GetAddressCalls

func (mock *MaintainerStateMock) GetAddressCalls() []struct {
}

GetAddressCalls gets all the calls that were made to GetAddress. Check the length with:

len(mockedMaintainerState.GetAddressCalls())

func (*MaintainerStateMock) MarkIncorrectVote

func (mock *MaintainerStateMock) MarkIncorrectVote(incorrectVote bool)

MarkIncorrectVote calls MarkIncorrectVoteFunc.

func (*MaintainerStateMock) MarkIncorrectVoteCalls

func (mock *MaintainerStateMock) MarkIncorrectVoteCalls() []struct {
	IncorrectVote bool
}

MarkIncorrectVoteCalls gets all the calls that were made to MarkIncorrectVote. Check the length with:

len(mockedMaintainerState.MarkIncorrectVoteCalls())

func (*MaintainerStateMock) MarkMissingVote

func (mock *MaintainerStateMock) MarkMissingVote(missingVote bool)

MarkMissingVote calls MarkMissingVoteFunc.

func (*MaintainerStateMock) MarkMissingVoteCalls

func (mock *MaintainerStateMock) MarkMissingVoteCalls() []struct {
	MissingVote bool
}

MarkMissingVoteCalls gets all the calls that were made to MarkMissingVote. Check the length with:

len(mockedMaintainerState.MarkMissingVoteCalls())

func (*MaintainerStateMock) Marshal

func (mock *MaintainerStateMock) Marshal() ([]byte, error)

Marshal calls MarshalFunc.

func (*MaintainerStateMock) MarshalCalls

func (mock *MaintainerStateMock) MarshalCalls() []struct {
}

MarshalCalls gets all the calls that were made to Marshal. Check the length with:

len(mockedMaintainerState.MarshalCalls())

func (*MaintainerStateMock) MarshalTo

func (mock *MaintainerStateMock) MarshalTo(data []byte) (int, error)

MarshalTo calls MarshalToFunc.

func (*MaintainerStateMock) MarshalToCalls

func (mock *MaintainerStateMock) MarshalToCalls() []struct {
	Data []byte
}

MarshalToCalls gets all the calls that were made to MarshalTo. Check the length with:

len(mockedMaintainerState.MarshalToCalls())

func (*MaintainerStateMock) MarshalToSizedBuffer

func (mock *MaintainerStateMock) MarshalToSizedBuffer(dAtA []byte) (int, error)

MarshalToSizedBuffer calls MarshalToSizedBufferFunc.

func (*MaintainerStateMock) MarshalToSizedBufferCalls

func (mock *MaintainerStateMock) MarshalToSizedBufferCalls() []struct {
	DAtA []byte
}

MarshalToSizedBufferCalls gets all the calls that were made to MarshalToSizedBuffer. Check the length with:

len(mockedMaintainerState.MarshalToSizedBufferCalls())

func (*MaintainerStateMock) ProtoMessage

func (mock *MaintainerStateMock) ProtoMessage()

ProtoMessage calls ProtoMessageFunc.

func (*MaintainerStateMock) ProtoMessageCalls

func (mock *MaintainerStateMock) ProtoMessageCalls() []struct {
}

ProtoMessageCalls gets all the calls that were made to ProtoMessage. Check the length with:

len(mockedMaintainerState.ProtoMessageCalls())

func (*MaintainerStateMock) Reset

func (mock *MaintainerStateMock) Reset()

Reset calls ResetFunc.

func (*MaintainerStateMock) ResetCalls

func (mock *MaintainerStateMock) ResetCalls() []struct {
}

ResetCalls gets all the calls that were made to Reset. Check the length with:

len(mockedMaintainerState.ResetCalls())

func (*MaintainerStateMock) Size

func (mock *MaintainerStateMock) Size() int

Size calls SizeFunc.

func (*MaintainerStateMock) SizeCalls

func (mock *MaintainerStateMock) SizeCalls() []struct {
}

SizeCalls gets all the calls that were made to Size. Check the length with:

len(mockedMaintainerState.SizeCalls())

func (*MaintainerStateMock) String

func (mock *MaintainerStateMock) String() string

String calls StringFunc.

func (*MaintainerStateMock) StringCalls

func (mock *MaintainerStateMock) StringCalls() []struct {
}

StringCalls gets all the calls that were made to String. Check the length with:

len(mockedMaintainerState.StringCalls())

func (*MaintainerStateMock) Unmarshal

func (mock *MaintainerStateMock) Unmarshal(data []byte) error

Unmarshal calls UnmarshalFunc.

func (*MaintainerStateMock) UnmarshalCalls

func (mock *MaintainerStateMock) UnmarshalCalls() []struct {
	Data []byte
}

UnmarshalCalls gets all the calls that were made to Unmarshal. Check the length with:

len(mockedMaintainerState.UnmarshalCalls())

Jump to

Keyboard shortcuts

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