Documentation
¶
Overview ¶
Package mock provides the small mock API subset used by generated internal test mocks.
Index ¶
- Constants
- func AnythingOfType(t string) any
- func MatchedBy(fn any) any
- type Arguments
- type Call
- type Mock
- func (m *Mock) AssertExpectations(t TestingT) bool
- func (m *Mock) AssertNotCalled(t TestingT, method string, args ...any) bool
- func (m *Mock) Called(args ...any) Arguments
- func (m *Mock) MethodCalled(method string, args ...any) Arguments
- func (m *Mock) On(method string, args ...any) *Call
- func (m *Mock) Test(t TestingT)
- type TestingT
Constants ¶
View Source
const Anything = "mock.Anything"
Anything matches any argument.
Variables ¶
This section is empty.
Functions ¶
func AnythingOfType ¶
AnythingOfType matches arguments with the provided reflected type string.
Types ¶
type Arguments ¶
type Arguments []any
Arguments contains method call arguments or return values.
type Call ¶
type Call struct {
// Method is the expected method name.
Method string
// contains filtered or unexported fields
}
Call configures a single expected method call.
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
Mock records expected method calls.
func (*Mock) AssertExpectations ¶
AssertExpectations verifies that all required calls happened.
func (*Mock) AssertNotCalled ¶
AssertNotCalled verifies that method was not called with matching arguments.
func (*Mock) MethodCalled ¶
MethodCalled records method and returns the configured return values.
Click to show internal directories.
Click to hide internal directories.