generate

package
v2.0.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyInterface

type MyInterface interface {
	One() bool
	Two() int
	Three() string
}

MyInterface is a test interface.

type MyInterfaceMock

type MyInterfaceMock struct {
	// OneFunc mocks the One method.
	OneFunc func() bool

	// ThreeFunc mocks the Three method.
	ThreeFunc func() string

	// TwoFunc mocks the Two method.
	TwoFunc func() int
	// contains filtered or unexported fields
}

MyInterfaceMock is a mock implementation of MyInterface.

    func TestSomethingThatUsesMyInterface(t *testing.T) {

        // make and configure a mocked MyInterface
        mockedMyInterface := &MyInterfaceMock{
            OneFunc: func() bool {
	               panic("moqInstance out the One method")
            },
            ThreeFunc: func() string {
	               panic("moqInstance out the Three method")
            },
            TwoFunc: func() int {
	               panic("moqInstance out the Two method")
            },
        }

        // use mockedMyInterface in code that requires MyInterface
        // and then make assertions.

    }

func (*MyInterfaceMock) One

func (moqInstance *MyInterfaceMock) One() bool

One calls OneFunc.

func (*MyInterfaceMock) OneCalls

func (moqInstance *MyInterfaceMock) OneCalls() []MyInterfaceMockOneCall

OneCalls gets all the calls that were made to One. Check the length with:

len(mockedMyInterface.OneCalls())

func (*MyInterfaceMock) Three

func (moqInstance *MyInterfaceMock) Three() string

Three calls ThreeFunc.

func (*MyInterfaceMock) ThreeCalls

func (moqInstance *MyInterfaceMock) ThreeCalls() []MyInterfaceMockThreeCall

ThreeCalls gets all the calls that were made to Three. Check the length with:

len(mockedMyInterface.ThreeCalls())

func (*MyInterfaceMock) Two

func (moqInstance *MyInterfaceMock) Two() int

Two calls TwoFunc.

func (*MyInterfaceMock) TwoCalls

func (moqInstance *MyInterfaceMock) TwoCalls() []MyInterfaceMockTwoCall

TwoCalls gets all the calls that were made to Two. Check the length with:

len(mockedMyInterface.TwoCalls())

type MyInterfaceMockOneCall

type MyInterfaceMockOneCall struct {
	In  MyInterfaceMockOneCallInput
	Out MyInterfaceMockOneCallOutput
}

MyInterfaceMockOneCall represents the input and output for a MyInterfaceMock.One call.

type MyInterfaceMockOneCallInput

type MyInterfaceMockOneCallInput struct {
}

MyInterfaceMockOneCallInput represents the input to a MyInterfaceMock.One call.

type MyInterfaceMockOneCallOutput

type MyInterfaceMockOneCallOutput struct {
	Out1 bool
}

MyInterfaceMockOneCallOutput represents the output for a MyInterfaceMock.One call.

type MyInterfaceMockThreeCall

type MyInterfaceMockThreeCall struct {
	In  MyInterfaceMockThreeCallInput
	Out MyInterfaceMockThreeCallOutput
}

MyInterfaceMockThreeCall represents the input and output for a MyInterfaceMock.Three call.

type MyInterfaceMockThreeCallInput

type MyInterfaceMockThreeCallInput struct {
}

MyInterfaceMockThreeCallInput represents the input to a MyInterfaceMock.Three call.

type MyInterfaceMockThreeCallOutput

type MyInterfaceMockThreeCallOutput struct {
	Out1 string
}

MyInterfaceMockThreeCallOutput represents the output for a MyInterfaceMock.Three call.

type MyInterfaceMockTwoCall

type MyInterfaceMockTwoCall struct {
	In  MyInterfaceMockTwoCallInput
	Out MyInterfaceMockTwoCallOutput
}

MyInterfaceMockTwoCall represents the input and output for a MyInterfaceMock.Two call.

type MyInterfaceMockTwoCallInput

type MyInterfaceMockTwoCallInput struct {
}

MyInterfaceMockTwoCallInput represents the input to a MyInterfaceMock.Two call.

type MyInterfaceMockTwoCallOutput

type MyInterfaceMockTwoCallOutput struct {
	Out1 int
}

MyInterfaceMockTwoCallOutput represents the output for a MyInterfaceMock.Two call.

Jump to

Keyboard shortcuts

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