mock

package
v0.35.3 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 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 PacketIMock

type PacketIMock struct {
	// GetDataFunc mocks the GetData method.
	GetDataFunc func() []byte

	// GetDestChannelFunc mocks the GetDestChannel method.
	GetDestChannelFunc func() string

	// GetDestPortFunc mocks the GetDestPort method.
	GetDestPortFunc func() string

	// GetSequenceFunc mocks the GetSequence method.
	GetSequenceFunc func() uint64

	// GetSourceChannelFunc mocks the GetSourceChannel method.
	GetSourceChannelFunc func() string

	// GetSourcePortFunc mocks the GetSourcePort method.
	GetSourcePortFunc func() string

	// GetTimeoutHeightFunc mocks the GetTimeoutHeight method.
	GetTimeoutHeightFunc func() ibcexported.Height

	// GetTimeoutTimestampFunc mocks the GetTimeoutTimestamp method.
	GetTimeoutTimestampFunc func() uint64

	// ValidateBasicFunc mocks the ValidateBasic method.
	ValidateBasicFunc func() error
	// contains filtered or unexported fields
}

PacketIMock is a mock implementation of app.PacketI.

func TestSomethingThatUsesPacketI(t *testing.T) {

	// make and configure a mocked app.PacketI
	mockedPacketI := &PacketIMock{
		GetDataFunc: func() []byte {
			panic("mock out the GetData method")
		},
		GetDestChannelFunc: func() string {
			panic("mock out the GetDestChannel method")
		},
		GetDestPortFunc: func() string {
			panic("mock out the GetDestPort method")
		},
		GetSequenceFunc: func() uint64 {
			panic("mock out the GetSequence method")
		},
		GetSourceChannelFunc: func() string {
			panic("mock out the GetSourceChannel method")
		},
		GetSourcePortFunc: func() string {
			panic("mock out the GetSourcePort method")
		},
		GetTimeoutHeightFunc: func() ibcexported.Height {
			panic("mock out the GetTimeoutHeight method")
		},
		GetTimeoutTimestampFunc: func() uint64 {
			panic("mock out the GetTimeoutTimestamp method")
		},
		ValidateBasicFunc: func() error {
			panic("mock out the ValidateBasic method")
		},
	}

	// use mockedPacketI in code that requires app.PacketI
	// and then make assertions.

}

func (*PacketIMock) GetData

func (mock *PacketIMock) GetData() []byte

GetData calls GetDataFunc.

func (*PacketIMock) GetDataCalls

func (mock *PacketIMock) GetDataCalls() []struct {
}

GetDataCalls gets all the calls that were made to GetData. Check the length with:

len(mockedPacketI.GetDataCalls())

func (*PacketIMock) GetDestChannel

func (mock *PacketIMock) GetDestChannel() string

GetDestChannel calls GetDestChannelFunc.

func (*PacketIMock) GetDestChannelCalls

func (mock *PacketIMock) GetDestChannelCalls() []struct {
}

GetDestChannelCalls gets all the calls that were made to GetDestChannel. Check the length with:

len(mockedPacketI.GetDestChannelCalls())

func (*PacketIMock) GetDestPort

func (mock *PacketIMock) GetDestPort() string

GetDestPort calls GetDestPortFunc.

func (*PacketIMock) GetDestPortCalls

func (mock *PacketIMock) GetDestPortCalls() []struct {
}

GetDestPortCalls gets all the calls that were made to GetDestPort. Check the length with:

len(mockedPacketI.GetDestPortCalls())

func (*PacketIMock) GetSequence

func (mock *PacketIMock) GetSequence() uint64

GetSequence calls GetSequenceFunc.

func (*PacketIMock) GetSequenceCalls

func (mock *PacketIMock) GetSequenceCalls() []struct {
}

GetSequenceCalls gets all the calls that were made to GetSequence. Check the length with:

len(mockedPacketI.GetSequenceCalls())

func (*PacketIMock) GetSourceChannel

func (mock *PacketIMock) GetSourceChannel() string

GetSourceChannel calls GetSourceChannelFunc.

func (*PacketIMock) GetSourceChannelCalls

func (mock *PacketIMock) GetSourceChannelCalls() []struct {
}

GetSourceChannelCalls gets all the calls that were made to GetSourceChannel. Check the length with:

len(mockedPacketI.GetSourceChannelCalls())

func (*PacketIMock) GetSourcePort

func (mock *PacketIMock) GetSourcePort() string

GetSourcePort calls GetSourcePortFunc.

func (*PacketIMock) GetSourcePortCalls

func (mock *PacketIMock) GetSourcePortCalls() []struct {
}

GetSourcePortCalls gets all the calls that were made to GetSourcePort. Check the length with:

len(mockedPacketI.GetSourcePortCalls())

func (*PacketIMock) GetTimeoutHeight

func (mock *PacketIMock) GetTimeoutHeight() ibcexported.Height

GetTimeoutHeight calls GetTimeoutHeightFunc.

func (*PacketIMock) GetTimeoutHeightCalls

func (mock *PacketIMock) GetTimeoutHeightCalls() []struct {
}

GetTimeoutHeightCalls gets all the calls that were made to GetTimeoutHeight. Check the length with:

len(mockedPacketI.GetTimeoutHeightCalls())

func (*PacketIMock) GetTimeoutTimestamp

func (mock *PacketIMock) GetTimeoutTimestamp() uint64

GetTimeoutTimestamp calls GetTimeoutTimestampFunc.

func (*PacketIMock) GetTimeoutTimestampCalls

func (mock *PacketIMock) GetTimeoutTimestampCalls() []struct {
}

GetTimeoutTimestampCalls gets all the calls that were made to GetTimeoutTimestamp. Check the length with:

len(mockedPacketI.GetTimeoutTimestampCalls())

func (*PacketIMock) ValidateBasic

func (mock *PacketIMock) ValidateBasic() error

ValidateBasic calls ValidateBasicFunc.

func (*PacketIMock) ValidateBasicCalls

func (mock *PacketIMock) ValidateBasicCalls() []struct {
}

ValidateBasicCalls gets all the calls that were made to ValidateBasic. Check the length with:

len(mockedPacketI.ValidateBasicCalls())

Jump to

Keyboard shortcuts

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