Documentation ¶
Index ¶
- func AnyBool() bool
- func AnyBoolSlice() []bool
- func AnyComplex128() complex128
- func AnyComplex128Slice() []complex128
- func AnyComplex64() complex64
- func AnyComplex64Slice() []complex64
- func AnyFloat32() float32
- func AnyFloat32Slice() []float32
- func AnyFloat64() float64
- func AnyFloat64Slice() []float64
- func AnyInt() int
- func AnyInt16() int16
- func AnyInt16Slice() []int16
- func AnyInt32() int32
- func AnyInt32Slice() []int32
- func AnyInt64() int64
- func AnyInt64Slice() []int64
- func AnyInt8() int8
- func AnyInt8Slice() []int8
- func AnyIntSlice() []int
- func AnyInterface() interface{}
- func AnyInterfaceSlice() []interface{}
- func AnyString() string
- func AnyStringSlice() []string
- func AnyUint() uint
- func AnyUint16() uint16
- func AnyUint16Slice() []uint16
- func AnyUint32() uint32
- func AnyUint32Slice() []uint32
- func AnyUint64() uint64
- func AnyUint64Slice() []uint64
- func AnyUint8() uint8
- func AnyUint8Slice() []uint8
- func AnyUintSlice() []uint
- func AnyUintptr() uintptr
- func AnyUintptrSlice() []uintptr
- func BoolSliceThat(matcher ArgumentMatcher) []bool
- func BoolThat(matcher ArgumentMatcher) bool
- func Complex128SliceThat(matcher ArgumentMatcher) []complex128
- func Complex128That(matcher ArgumentMatcher) complex128
- func Complex64SliceThat(matcher ArgumentMatcher) []complex64
- func Complex64That(matcher ArgumentMatcher) complex64
- func DumpInvocationsFor(mock Mock)
- func EqBool(value bool) bool
- func EqBoolSlice(value []bool) []bool
- func EqComplex128(value complex128) complex128
- func EqComplex128Slice(value []complex128) []complex128
- func EqComplex64(value complex64) complex64
- func EqComplex64Slice(value []complex64) []complex64
- func EqFloat32(value float32) float32
- func EqFloat32Slice(value []float32) []float32
- func EqFloat64(value float64) float64
- func EqFloat64Slice(value []float64) []float64
- func EqInt(value int) int
- func EqInt16(value int16) int16
- func EqInt16Slice(value []int16) []int16
- func EqInt32(value int32) int32
- func EqInt32Slice(value []int32) []int32
- func EqInt64(value int64) int64
- func EqInt64Slice(value []int64) []int64
- func EqInt8(value int8) int8
- func EqInt8Slice(value []int8) []int8
- func EqIntSlice(value []int) []int
- func EqInterface(value interface{}) interface{}
- func EqInterfaceSlice(value []interface{}) []interface{}
- func EqString(value string) string
- func EqStringSlice(value []string) []string
- func EqUint(value uint) uint
- func EqUint16(value uint16) uint16
- func EqUint16Slice(value []uint16) []uint16
- func EqUint32(value uint32) uint32
- func EqUint32Slice(value []uint32) []uint32
- func EqUint64(value uint64) uint64
- func EqUint64Slice(value []uint64) []uint64
- func EqUint8(value uint8) uint8
- func EqUint8Slice(value []uint8) []uint8
- func EqUintSlice(value []uint) []uint
- func EqUintptr(value uintptr) uintptr
- func EqUintptrSlice(value []uintptr) []uintptr
- func Float32SliceThat(matcher ArgumentMatcher) []float32
- func Float32That(matcher ArgumentMatcher) float32
- func Float64SliceThat(matcher ArgumentMatcher) []float64
- func Float64That(matcher ArgumentMatcher) float64
- func Int16SliceThat(matcher ArgumentMatcher) []int16
- func Int16That(matcher ArgumentMatcher) int16
- func Int32SliceThat(matcher ArgumentMatcher) []int32
- func Int32That(matcher ArgumentMatcher) int32
- func Int64SliceThat(matcher ArgumentMatcher) []int64
- func Int64That(matcher ArgumentMatcher) int64
- func Int8SliceThat(matcher ArgumentMatcher) []int8
- func Int8That(matcher ArgumentMatcher) int8
- func IntSliceThat(matcher ArgumentMatcher) []int
- func IntThat(matcher ArgumentMatcher) int
- func InterceptMockFailures(f func()) []string
- func InterfaceSliceThat(matcher ArgumentMatcher) []interface{}
- func InterfaceThat(matcher ArgumentMatcher) interface{}
- func NotEqBool(value bool) bool
- func NotEqBoolSlice(value []bool) []bool
- func NotEqComplex128(value complex128) complex128
- func NotEqComplex128Slice(value []complex128) []complex128
- func NotEqComplex64(value complex64) complex64
- func NotEqComplex64Slice(value []complex64) []complex64
- func NotEqFloat32(value float32) float32
- func NotEqFloat32Slice(value []float32) []float32
- func NotEqFloat64(value float64) float64
- func NotEqFloat64Slice(value []float64) []float64
- func NotEqInt(value int) int
- func NotEqInt16(value int16) int16
- func NotEqInt16Slice(value []int16) []int16
- func NotEqInt32(value int32) int32
- func NotEqInt32Slice(value []int32) []int32
- func NotEqInt64(value int64) int64
- func NotEqInt64Slice(value []int64) []int64
- func NotEqInt8(value int8) int8
- func NotEqInt8Slice(value []int8) []int8
- func NotEqIntSlice(value []int) []int
- func NotEqInterface(value interface{}) interface{}
- func NotEqInterfaceSlice(value []interface{}) []interface{}
- func NotEqString(value string) string
- func NotEqStringSlice(value []string) []string
- func NotEqUint(value uint) uint
- func NotEqUint16(value uint16) uint16
- func NotEqUint16Slice(value []uint16) []uint16
- func NotEqUint32(value uint32) uint32
- func NotEqUint32Slice(value []uint32) []uint32
- func NotEqUint64(value uint64) uint64
- func NotEqUint64Slice(value []uint64) []uint64
- func NotEqUint8(value uint8) uint8
- func NotEqUint8Slice(value []uint8) []uint8
- func NotEqUintSlice(value []uint) []uint
- func NotEqUintptr(value uintptr) uintptr
- func NotEqUintptrSlice(value []uintptr) []uintptr
- func RegisterMatcher(matcher ArgumentMatcher)
- func RegisterMockFailHandler(handler FailHandler)
- func RegisterMockTestingT(t *testing.T)
- func SDumpInvocationsFor(mock Mock) string
- func StringSliceThat(matcher ArgumentMatcher) []string
- func StringThat(matcher ArgumentMatcher) string
- func Uint16SliceThat(matcher ArgumentMatcher) []uint16
- func Uint16That(matcher ArgumentMatcher) uint16
- func Uint32SliceThat(matcher ArgumentMatcher) []uint32
- func Uint32That(matcher ArgumentMatcher) uint32
- func Uint64SliceThat(matcher ArgumentMatcher) []uint64
- func Uint64That(matcher ArgumentMatcher) uint64
- func Uint8SliceThat(matcher ArgumentMatcher) []uint8
- func Uint8That(matcher ArgumentMatcher) uint8
- func UintSliceThat(matcher ArgumentMatcher) []uint
- func UintThat(matcher ArgumentMatcher) uint
- func UintptrSliceThat(matcher ArgumentMatcher) []uintptr
- func UintptrThat(matcher ArgumentMatcher) uintptr
- func When(invocation ...interface{}) *ongoingStubbing
- type AnyMatcher
- type ArgumentMatcher
- type AtLeastIntMatcher
- type AtMostIntMatcher
- type Counter
- type EqMatcher
- type FailHandler
- type GenericMock
- func (genericMock *GenericMock) GetInvocationParams(methodInvocations []MethodInvocation) [][]Param
- func (genericMock *GenericMock) Invoke(methodName string, params []Param, returnTypes []reflect.Type) ReturnValues
- func (genericMock *GenericMock) Verify(inOrderContext *InOrderContext, invocationCountMatcher InvocationCountMatcher, ...) []MethodInvocation
- type InOrderContext
- type InvocationCountMatcher
- type Matcher
- type Matchers
- type MethodInvocation
- type Mock
- type NotEqMatcher
- type Option
- type OptionFunc
- type Param
- type ReturnValue
- type ReturnValues
- type Stubbing
- type Stubbings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyBoolSlice ¶
func AnyBoolSlice() []bool
func AnyComplex128 ¶
func AnyComplex128() complex128
func AnyComplex128Slice ¶
func AnyComplex128Slice() []complex128
func AnyComplex64 ¶
func AnyComplex64() complex64
func AnyComplex64Slice ¶
func AnyComplex64Slice() []complex64
func AnyFloat32 ¶
func AnyFloat32() float32
func AnyFloat32Slice ¶
func AnyFloat32Slice() []float32
func AnyFloat64 ¶
func AnyFloat64() float64
func AnyFloat64Slice ¶
func AnyFloat64Slice() []float64
func AnyInt16Slice ¶
func AnyInt16Slice() []int16
func AnyInt32Slice ¶
func AnyInt32Slice() []int32
func AnyInt64Slice ¶
func AnyInt64Slice() []int64
func AnyInt8Slice ¶
func AnyInt8Slice() []int8
func AnyIntSlice ¶
func AnyIntSlice() []int
func AnyInterface ¶
func AnyInterface() interface{}
func AnyInterfaceSlice ¶
func AnyInterfaceSlice() []interface{}
func AnyStringSlice ¶
func AnyStringSlice() []string
func AnyUint16Slice ¶
func AnyUint16Slice() []uint16
func AnyUint32Slice ¶
func AnyUint32Slice() []uint32
func AnyUint64Slice ¶
func AnyUint64Slice() []uint64
func AnyUint8Slice ¶
func AnyUint8Slice() []uint8
func AnyUintSlice ¶
func AnyUintSlice() []uint
func AnyUintptr ¶
func AnyUintptr() uintptr
func AnyUintptrSlice ¶
func AnyUintptrSlice() []uintptr
func BoolSliceThat ¶
func BoolSliceThat(matcher ArgumentMatcher) []bool
func BoolThat ¶
func BoolThat(matcher ArgumentMatcher) bool
func Complex128SliceThat ¶
func Complex128SliceThat(matcher ArgumentMatcher) []complex128
func Complex128That ¶
func Complex128That(matcher ArgumentMatcher) complex128
func Complex64SliceThat ¶
func Complex64SliceThat(matcher ArgumentMatcher) []complex64
func Complex64That ¶
func Complex64That(matcher ArgumentMatcher) complex64
func DumpInvocationsFor ¶
func DumpInvocationsFor(mock Mock)
func EqBoolSlice ¶
func EqComplex128 ¶
func EqComplex128(value complex128) complex128
func EqComplex128Slice ¶
func EqComplex128Slice(value []complex128) []complex128
func EqComplex64 ¶
func EqComplex64Slice ¶
func EqFloat32Slice ¶
func EqFloat64Slice ¶
func EqInt16Slice ¶
func EqInt32Slice ¶
func EqInt64Slice ¶
func EqInt8Slice ¶
func EqIntSlice ¶
func EqInterface ¶
func EqInterface(value interface{}) interface{}
func EqInterfaceSlice ¶
func EqInterfaceSlice(value []interface{}) []interface{}
func EqStringSlice ¶
func EqUint16Slice ¶
func EqUint32Slice ¶
func EqUint64Slice ¶
func EqUint8Slice ¶
func EqUintSlice ¶
func EqUintptrSlice ¶
func Float32SliceThat ¶
func Float32SliceThat(matcher ArgumentMatcher) []float32
func Float32That ¶
func Float32That(matcher ArgumentMatcher) float32
func Float64SliceThat ¶
func Float64SliceThat(matcher ArgumentMatcher) []float64
func Float64That ¶
func Float64That(matcher ArgumentMatcher) float64
func Int16SliceThat ¶
func Int16SliceThat(matcher ArgumentMatcher) []int16
func Int16That ¶
func Int16That(matcher ArgumentMatcher) int16
func Int32SliceThat ¶
func Int32SliceThat(matcher ArgumentMatcher) []int32
func Int32That ¶
func Int32That(matcher ArgumentMatcher) int32
func Int64SliceThat ¶
func Int64SliceThat(matcher ArgumentMatcher) []int64
func Int64That ¶
func Int64That(matcher ArgumentMatcher) int64
func Int8SliceThat ¶
func Int8SliceThat(matcher ArgumentMatcher) []int8
func Int8That ¶
func Int8That(matcher ArgumentMatcher) int8
func IntSliceThat ¶
func IntSliceThat(matcher ArgumentMatcher) []int
func IntThat ¶
func IntThat(matcher ArgumentMatcher) int
func InterceptMockFailures ¶
func InterceptMockFailures(f func()) []string
InterceptMockFailures runs a given callback and returns an array of failure messages generated by any Pegomock verifications within the callback.
This is accomplished by temporarily replacing the *global* fail handler with a fail handler that simply annotates failures. The original fail handler is reset when InterceptMockFailures returns.
func InterfaceSliceThat ¶
func InterfaceSliceThat(matcher ArgumentMatcher) []interface{}
func InterfaceThat ¶
func InterfaceThat(matcher ArgumentMatcher) interface{}
func NotEqBoolSlice ¶
func NotEqComplex128 ¶
func NotEqComplex128(value complex128) complex128
func NotEqComplex128Slice ¶
func NotEqComplex128Slice(value []complex128) []complex128
func NotEqComplex64 ¶
func NotEqComplex64Slice ¶
func NotEqFloat32 ¶
func NotEqFloat32Slice ¶
func NotEqFloat64 ¶
func NotEqFloat64Slice ¶
func NotEqInt16 ¶
func NotEqInt16Slice ¶
func NotEqInt32 ¶
func NotEqInt32Slice ¶
func NotEqInt64 ¶
func NotEqInt64Slice ¶
func NotEqInt8Slice ¶
func NotEqIntSlice ¶
func NotEqInterface ¶
func NotEqInterface(value interface{}) interface{}
func NotEqInterfaceSlice ¶
func NotEqInterfaceSlice(value []interface{}) []interface{}
func NotEqString ¶
func NotEqStringSlice ¶
func NotEqUint16 ¶
func NotEqUint16Slice ¶
func NotEqUint32 ¶
func NotEqUint32Slice ¶
func NotEqUint64 ¶
func NotEqUint64Slice ¶
func NotEqUint8 ¶
func NotEqUint8Slice ¶
func NotEqUintSlice ¶
func NotEqUintptr ¶
func NotEqUintptrSlice ¶
func RegisterMatcher ¶
func RegisterMatcher(matcher ArgumentMatcher)
func RegisterMockFailHandler ¶
func RegisterMockFailHandler(handler FailHandler)
func RegisterMockTestingT ¶
func SDumpInvocationsFor ¶
func StringSliceThat ¶
func StringSliceThat(matcher ArgumentMatcher) []string
func StringThat ¶
func StringThat(matcher ArgumentMatcher) string
func Uint16SliceThat ¶
func Uint16SliceThat(matcher ArgumentMatcher) []uint16
func Uint16That ¶
func Uint16That(matcher ArgumentMatcher) uint16
func Uint32SliceThat ¶
func Uint32SliceThat(matcher ArgumentMatcher) []uint32
func Uint32That ¶
func Uint32That(matcher ArgumentMatcher) uint32
func Uint64SliceThat ¶
func Uint64SliceThat(matcher ArgumentMatcher) []uint64
func Uint64That ¶
func Uint64That(matcher ArgumentMatcher) uint64
func Uint8SliceThat ¶
func Uint8SliceThat(matcher ArgumentMatcher) []uint8
func Uint8That ¶
func Uint8That(matcher ArgumentMatcher) uint8
func UintSliceThat ¶
func UintSliceThat(matcher ArgumentMatcher) []uint
func UintThat ¶
func UintThat(matcher ArgumentMatcher) uint
func UintptrSliceThat ¶
func UintptrSliceThat(matcher ArgumentMatcher) []uintptr
func UintptrThat ¶
func UintptrThat(matcher ArgumentMatcher) uintptr
Types ¶
type AnyMatcher ¶
func NewAnyMatcher ¶
func NewAnyMatcher(typ reflect.Type) *AnyMatcher
func (*AnyMatcher) FailureMessage ¶
func (matcher *AnyMatcher) FailureMessage() string
func (*AnyMatcher) Matches ¶
func (matcher *AnyMatcher) Matches(param Param) bool
func (*AnyMatcher) String ¶
func (matcher *AnyMatcher) String() string
type ArgumentMatcher ¶
ArgumentMatcher can be used to match arguments.
type AtLeastIntMatcher ¶
type AtLeastIntMatcher struct { Value int // contains filtered or unexported fields }
func AtLeast ¶
func AtLeast(numDesiredInvocations int) *AtLeastIntMatcher
func (*AtLeastIntMatcher) FailureMessage ¶
func (matcher *AtLeastIntMatcher) FailureMessage() string
func (*AtLeastIntMatcher) Matches ¶
func (matcher *AtLeastIntMatcher) Matches(param Param) bool
func (*AtLeastIntMatcher) String ¶
func (matcher *AtLeastIntMatcher) String() string
type AtMostIntMatcher ¶
type AtMostIntMatcher struct { Value int // contains filtered or unexported fields }
func AtMost ¶
func AtMost(numDesiredInvocations int) *AtMostIntMatcher
func (*AtMostIntMatcher) FailureMessage ¶
func (matcher *AtMostIntMatcher) FailureMessage() string
func (*AtMostIntMatcher) Matches ¶
func (matcher *AtMostIntMatcher) Matches(param Param) bool
func (*AtMostIntMatcher) String ¶
func (matcher *AtMostIntMatcher) String() string
type EqMatcher ¶
func (*EqMatcher) FailureMessage ¶
type FailHandler ¶
var GlobalFailHandler FailHandler
func BuildTestingTFailHandler ¶
func BuildTestingTFailHandler(t testingT) FailHandler
type GenericMock ¶
func GetGenericMockFrom ¶
func GetGenericMockFrom(mock Mock) *GenericMock
func (*GenericMock) GetInvocationParams ¶
func (genericMock *GenericMock) GetInvocationParams(methodInvocations []MethodInvocation) [][]Param
TODO this doesn't need to be a method, can be a free function
func (*GenericMock) Invoke ¶
func (genericMock *GenericMock) Invoke(methodName string, params []Param, returnTypes []reflect.Type) ReturnValues
func (*GenericMock) Verify ¶
func (genericMock *GenericMock) Verify( inOrderContext *InOrderContext, invocationCountMatcher InvocationCountMatcher, methodName string, params []Param, options ...interface{}, ) []MethodInvocation
type InOrderContext ¶
type InOrderContext struct {
// contains filtered or unexported fields
}
type InvocationCountMatcher ¶
InvocationCountMatcher can be used to match invocation counts. It is guaranteed that FailureMessage will always be called after Matches so an implementation can save state.
type Matcher ¶
Matcher can be used to match arguments as well as invocation counts. Note that support for overlapping embedded interfaces was added in Go 1.14, which is why ArgumentMatcher and InvocationCountMatcher are not embedded here.
type Matchers ¶
type Matchers []ArgumentMatcher
type MethodInvocation ¶
type MethodInvocation struct {
// contains filtered or unexported fields
}
type Mock ¶
type Mock interface { SetFailHandler(FailHandler) FailHandler() FailHandler }
type NotEqMatcher ¶
type NotEqMatcher struct {
Value Param
}
func (*NotEqMatcher) FailureMessage ¶
func (matcher *NotEqMatcher) FailureMessage() string
func (*NotEqMatcher) Matches ¶
func (matcher *NotEqMatcher) Matches(param Param) bool
func (*NotEqMatcher) String ¶
func (matcher *NotEqMatcher) String() string
type Option ¶
type Option interface{ Apply(Mock) }
func WithFailHandler ¶
func WithFailHandler(fail FailHandler) Option
type OptionFunc ¶
type OptionFunc func(mock Mock)
func (OptionFunc) Apply ¶
func (f OptionFunc) Apply(mock Mock)
type ReturnValue ¶
type ReturnValue interface{}
type ReturnValues ¶
type ReturnValues []ReturnValue
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
Code generated by pegomock.
|
Code generated by pegomock. |
MockGen generates mock implementations of Go interfaces.
|
MockGen generates mock implementations of Go interfaces. |
Package model contains the data model necessary for generating mock implementations.
|
Package model contains the data model necessary for generating mock implementations. |
modelgen
|
|