Documentation ¶
Index ¶
- type MyInterface
- type MyInterfaceMock
- func (moqInstance *MyInterfaceMock) One() bool
- func (moqInstance *MyInterfaceMock) OneCalls() []MyInterfaceMockOneCall
- func (moqInstance *MyInterfaceMock) Three() string
- func (moqInstance *MyInterfaceMock) ThreeCalls() []MyInterfaceMockThreeCall
- func (moqInstance *MyInterfaceMock) Two() int
- func (moqInstance *MyInterfaceMock) TwoCalls() []MyInterfaceMockTwoCall
- type MyInterfaceMockOneCall
- type MyInterfaceMockOneCallInput
- type MyInterfaceMockOneCallOutput
- type MyInterfaceMockThreeCall
- type MyInterfaceMockThreeCallInput
- type MyInterfaceMockThreeCallOutput
- type MyInterfaceMockTwoCall
- type MyInterfaceMockTwoCallInput
- type MyInterfaceMockTwoCallOutput
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("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) 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) 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.