Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MyInterface ¶
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) 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) 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) TwoCalls ¶
func (mock *MyInterfaceMock) TwoCalls() []struct { }
TwoCalls gets all the calls that were made to Two. Check the length with:
len(mockedMyInterface.TwoCalls())
Click to show internal directories.
Click to hide internal directories.