mock

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 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 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