Documentation
¶
Index ¶
- type MyInterface
- type MyInterfaceString
- type MyInterfaceStringMock
- func (mock *MyInterfaceStringMock) One(s string) bool
- func (mock *MyInterfaceStringMock) OneCalls() []struct{ ... }
- func (mock *MyInterfaceStringMock) Three() string
- func (mock *MyInterfaceStringMock) ThreeCalls() []struct{}
- func (mock *MyInterfaceStringMock) Two() int
- func (mock *MyInterfaceStringMock) TwoCalls() []struct{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MyInterface ¶
MyInterface is a test interface.
type MyInterfaceString ¶
type MyInterfaceString = MyInterface[string]
type MyInterfaceStringMock ¶
type MyInterfaceStringMock struct { // OneFunc mocks the One method. OneFunc func(s string) bool // ThreeFunc mocks the Three method. ThreeFunc func() string // TwoFunc mocks the Two method. TwoFunc func() int // contains filtered or unexported fields }
MyInterfaceStringMock is a mock implementation of MyInterfaceString.
func TestSomethingThatUsesMyInterfaceString(t *testing.T) { // make and configure a mocked MyInterfaceString mockedMyInterfaceString := &MyInterfaceStringMock{ OneFunc: func(s string) 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 mockedMyInterfaceString in code that requires MyInterfaceString // and then make assertions. }
func (*MyInterfaceStringMock) One ¶
func (mock *MyInterfaceStringMock) One(s string) bool
One calls OneFunc.
func (*MyInterfaceStringMock) OneCalls ¶
func (mock *MyInterfaceStringMock) OneCalls() []struct { S string }
OneCalls gets all the calls that were made to One. Check the length with:
len(mockedMyInterfaceString.OneCalls())
func (*MyInterfaceStringMock) Three ¶
func (mock *MyInterfaceStringMock) Three() string
Three calls ThreeFunc.
func (*MyInterfaceStringMock) ThreeCalls ¶
func (mock *MyInterfaceStringMock) ThreeCalls() []struct { }
ThreeCalls gets all the calls that were made to Three. Check the length with:
len(mockedMyInterfaceString.ThreeCalls())
func (*MyInterfaceStringMock) TwoCalls ¶
func (mock *MyInterfaceStringMock) TwoCalls() []struct { }
TwoCalls gets all the calls that were made to Two. Check the length with:
len(mockedMyInterfaceString.TwoCalls())
Click to show internal directories.
Click to hide internal directories.