generate

package
Version: v0.0.0-...-c45c141 Latest Latest
Warning

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

Go to latest
Published: May 7, 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("mock out the One method")
            },
            ThreeFunc: func() string {
	               panic("mock out the Three method")
            },
            TwoFunc: func() int {
	               panic("mock out the Two method")
            },
        }

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

    }

func (*MyInterfaceMock) One

func (mock *MyInterfaceMock) One() bool

One calls OneFunc.

func (*MyInterfaceMock) OneCalls

func (mock *MyInterfaceMock) OneCalls() []struct {
}

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

len(mockedMyInterface.OneCalls())

func (*MyInterfaceMock) Three

func (mock *MyInterfaceMock) Three() string

Three calls ThreeFunc.

func (*MyInterfaceMock) ThreeCalls

func (mock *MyInterfaceMock) ThreeCalls() []struct {
}

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

len(mockedMyInterface.ThreeCalls())

func (*MyInterfaceMock) Two

func (mock *MyInterfaceMock) Two() int

Two calls TwoFunc.

func (*MyInterfaceMock) TwoCalls

func (mock *MyInterfaceMock) TwoCalls() []struct {
}

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

len(mockedMyInterface.TwoCalls())

Jump to

Keyboard shortcuts

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