mock

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PollMock

type PollMock struct {
	// AllowOverrideFunc mocks the AllowOverride method.
	AllowOverrideFunc func()

	// DeleteFunc mocks the Delete method.
	DeleteFunc func() error

	// GetKeyFunc mocks the GetKey method.
	GetKeyFunc func() exported.PollKey

	// GetResultFunc mocks the GetResult method.
	GetResultFunc func() codec.ProtoMarshaler

	// GetTotalVotingPowerFunc mocks the GetTotalVotingPower method.
	GetTotalVotingPowerFunc func() github_com_cosmos_cosmos_sdk_types.Int

	// GetVotersFunc mocks the GetVoters method.
	GetVotersFunc func() []exported.Voter

	// IsFunc mocks the Is method.
	IsFunc func(state exported.PollState) bool

	// VoteFunc mocks the Vote method.
	VoteFunc func(voter github_com_cosmos_cosmos_sdk_types.ValAddress, data codec.ProtoMarshaler) error
	// contains filtered or unexported fields
}

PollMock is a mock implementation of exported.Poll.

func TestSomethingThatUsesPoll(t *testing.T) {

	// make and configure a mocked exported.Poll
	mockedPoll := &PollMock{
		AllowOverrideFunc: func()  {
			panic("mock out the AllowOverride method")
		},
		DeleteFunc: func() error {
			panic("mock out the Delete method")
		},
		GetKeyFunc: func() exported.PollKey {
			panic("mock out the GetKey method")
		},
		GetResultFunc: func() codec.ProtoMarshaler {
			panic("mock out the GetResult method")
		},
		GetTotalVotingPowerFunc: func() github_com_cosmos_cosmos_sdk_types.Int {
			panic("mock out the GetTotalVotingPower method")
		},
		GetVotersFunc: func() []exported.Voter {
			panic("mock out the GetVoters method")
		},
		IsFunc: func(state exported.PollState) bool {
			panic("mock out the Is method")
		},
		VoteFunc: func(voter github_com_cosmos_cosmos_sdk_types.ValAddress, data codec.ProtoMarshaler) error {
			panic("mock out the Vote method")
		},
	}

	// use mockedPoll in code that requires exported.Poll
	// and then make assertions.

}

func (*PollMock) AllowOverride

func (mock *PollMock) AllowOverride()

AllowOverride calls AllowOverrideFunc.

func (*PollMock) AllowOverrideCalls

func (mock *PollMock) AllowOverrideCalls() []struct {
}

AllowOverrideCalls gets all the calls that were made to AllowOverride. Check the length with:

len(mockedPoll.AllowOverrideCalls())

func (*PollMock) Delete

func (mock *PollMock) Delete() error

Delete calls DeleteFunc.

func (*PollMock) DeleteCalls

func (mock *PollMock) DeleteCalls() []struct {
}

DeleteCalls gets all the calls that were made to Delete. Check the length with:

len(mockedPoll.DeleteCalls())

func (*PollMock) GetKey

func (mock *PollMock) GetKey() exported.PollKey

GetKey calls GetKeyFunc.

func (*PollMock) GetKeyCalls

func (mock *PollMock) GetKeyCalls() []struct {
}

GetKeyCalls gets all the calls that were made to GetKey. Check the length with:

len(mockedPoll.GetKeyCalls())

func (*PollMock) GetResult

func (mock *PollMock) GetResult() codec.ProtoMarshaler

GetResult calls GetResultFunc.

func (*PollMock) GetResultCalls

func (mock *PollMock) GetResultCalls() []struct {
}

GetResultCalls gets all the calls that were made to GetResult. Check the length with:

len(mockedPoll.GetResultCalls())

func (*PollMock) GetTotalVotingPower

func (mock *PollMock) GetTotalVotingPower() github_com_cosmos_cosmos_sdk_types.Int

GetTotalVotingPower calls GetTotalVotingPowerFunc.

func (*PollMock) GetTotalVotingPowerCalls

func (mock *PollMock) GetTotalVotingPowerCalls() []struct {
}

GetTotalVotingPowerCalls gets all the calls that were made to GetTotalVotingPower. Check the length with:

len(mockedPoll.GetTotalVotingPowerCalls())

func (*PollMock) GetVoters

func (mock *PollMock) GetVoters() []exported.Voter

GetVoters calls GetVotersFunc.

func (*PollMock) GetVotersCalls

func (mock *PollMock) GetVotersCalls() []struct {
}

GetVotersCalls gets all the calls that were made to GetVoters. Check the length with:

len(mockedPoll.GetVotersCalls())

func (*PollMock) Is

func (mock *PollMock) Is(state exported.PollState) bool

Is calls IsFunc.

func (*PollMock) IsCalls

func (mock *PollMock) IsCalls() []struct {
	State exported.PollState
}

IsCalls gets all the calls that were made to Is. Check the length with:

len(mockedPoll.IsCalls())

func (*PollMock) Vote

Vote calls VoteFunc.

func (*PollMock) VoteCalls

func (mock *PollMock) VoteCalls() []struct {
	Voter github_com_cosmos_cosmos_sdk_types.ValAddress
	Data  codec.ProtoMarshaler
}

VoteCalls gets all the calls that were made to Vote. Check the length with:

len(mockedPoll.VoteCalls())

Jump to

Keyboard shortcuts

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