Documentation
¶
Overview ¶
Package generated is generated by make.go.mock from the interfaces found at package github.com/tcard/make.go.mock/examples.
Check out MyInterfaceMocker.
Index ¶
- type MyFuncFuncMockDescriptor
- type MyFuncFuncMockDescriptorWith1Arg
- func (d MyFuncFuncMockDescriptorWith1Arg) And(b int, opts ...cmp.Option) MyFuncFuncMockDescriptorWith2Args
- func (d MyFuncFuncMockDescriptorWith1Arg) AndAny() MyFuncFuncMockDescriptorWith2Args
- func (d MyFuncFuncMockDescriptorWith1Arg) AndMatching(match func(b int) error) MyFuncFuncMockDescriptorWith2Args
- type MyFuncFuncMockDescriptorWith2Args
- func (d MyFuncFuncMockDescriptorWith2Args) And(c int, opts ...cmp.Option) MyFuncFuncMockDescriptorWith3Args
- func (d MyFuncFuncMockDescriptorWith2Args) AndAny() MyFuncFuncMockDescriptorWith3Args
- func (d MyFuncFuncMockDescriptorWith2Args) AndMatching(match func(c int) error) MyFuncFuncMockDescriptorWith3Args
- type MyFuncFuncMockDescriptorWith3Args
- func (d MyFuncFuncMockDescriptorWith3Args) And(x bool, opts ...cmp.Option) MyFuncFuncMockDescriptorWith4Args
- func (d MyFuncFuncMockDescriptorWith3Args) AndAny() MyFuncFuncMockDescriptorWith4Args
- func (d MyFuncFuncMockDescriptorWith3Args) AndMatching(match func(x bool) error) MyFuncFuncMockDescriptorWith4Args
- type MyFuncFuncMockDescriptorWith4Args
- func (d MyFuncFuncMockDescriptorWith4Args) And(multi []examples.MyStruct, opts ...cmp.Option) MyFuncFuncMockDescriptorWith5Args
- func (d MyFuncFuncMockDescriptorWith4Args) AndAny() MyFuncFuncMockDescriptorWith5Args
- func (d MyFuncFuncMockDescriptorWith4Args) AndMatching(match func(multi []examples.MyStruct) error) MyFuncFuncMockDescriptorWith5Args
- type MyFuncFuncMockDescriptorWith5Args
- type MyFuncFuncMockDescriptorWithReturn
- func (d MyFuncFuncMockDescriptorWithReturn) AtLeastTimes(times int) MyFuncMockDescriptor
- func (d MyFuncFuncMockDescriptorWithReturn) Func() *MyFuncFuncMockDescriptor
- func (d MyFuncFuncMockDescriptorWithReturn) Mock() (m MyFuncMock, assert func(t interface{ ... }) (ok bool))
- func (d MyFuncFuncMockDescriptorWithReturn) Times(times int) MyFuncMockDescriptor
- func (d MyFuncFuncMockDescriptorWithReturn) TimesMatching(f func(times int) error) MyFuncMockDescriptor
- type MyFuncMock
- type MyFuncMockDescriptor
- type MyFuncMocker
- type MyInterfaceBoringMockDescriptor
- func (d *MyInterfaceBoringMockDescriptor) AtLeastTimes(times int) MyInterfaceMockDescriptor
- func (d *MyInterfaceBoringMockDescriptor) Boring() *MyInterfaceBoringMockDescriptor
- func (d *MyInterfaceBoringMockDescriptor) EmbeddedMethod() *MyInterfaceEmbeddedMethodMockDescriptor
- func (d *MyInterfaceBoringMockDescriptor) Mock() (m MyInterfaceMock, assert func(t interface{ ... }) (ok bool))
- func (d *MyInterfaceBoringMockDescriptor) ReturnSomethingAtLeast() *MyInterfaceReturnSomethingAtLeastMockDescriptor
- func (d *MyInterfaceBoringMockDescriptor) ShouldBeFun() *MyInterfaceShouldBeFunMockDescriptor
- func (d *MyInterfaceBoringMockDescriptor) StdSomething() *MyInterfaceStdSomethingMockDescriptor
- func (d *MyInterfaceBoringMockDescriptor) Times(times int) MyInterfaceMockDescriptor
- func (d *MyInterfaceBoringMockDescriptor) TimesMatching(f func(times int) error) MyInterfaceMockDescriptor
- type MyInterfaceEmbeddedMethodMockDescriptor
- func (d *MyInterfaceEmbeddedMethodMockDescriptor) AtLeastTimes(times int) MyInterfaceMockDescriptor
- func (d *MyInterfaceEmbeddedMethodMockDescriptor) Boring() *MyInterfaceBoringMockDescriptor
- func (d *MyInterfaceEmbeddedMethodMockDescriptor) EmbeddedMethod() *MyInterfaceEmbeddedMethodMockDescriptor
- func (d *MyInterfaceEmbeddedMethodMockDescriptor) Mock() (m MyInterfaceMock, assert func(t interface{ ... }) (ok bool))
- func (d *MyInterfaceEmbeddedMethodMockDescriptor) ReturnSomethingAtLeast() *MyInterfaceReturnSomethingAtLeastMockDescriptor
- func (d *MyInterfaceEmbeddedMethodMockDescriptor) ShouldBeFun() *MyInterfaceShouldBeFunMockDescriptor
- func (d *MyInterfaceEmbeddedMethodMockDescriptor) StdSomething() *MyInterfaceStdSomethingMockDescriptor
- func (d *MyInterfaceEmbeddedMethodMockDescriptor) Times(times int) MyInterfaceMockDescriptor
- func (d *MyInterfaceEmbeddedMethodMockDescriptor) TimesMatching(f func(times int) error) MyInterfaceMockDescriptor
- type MyInterfaceMock
- type MyInterfaceMockDescriptor
- func (d MyInterfaceMockDescriptor) Boring() *MyInterfaceBoringMockDescriptor
- func (d MyInterfaceMockDescriptor) EmbeddedMethod() *MyInterfaceEmbeddedMethodMockDescriptor
- func (d MyInterfaceMockDescriptor) Mock() (m MyInterfaceMock, assert func(t interface{ ... }) (ok bool))
- func (d MyInterfaceMockDescriptor) ReturnSomethingAtLeast() *MyInterfaceReturnSomethingAtLeastMockDescriptor
- func (d MyInterfaceMockDescriptor) ShouldBeFun() *MyInterfaceShouldBeFunMockDescriptor
- func (d MyInterfaceMockDescriptor) StdSomething() *MyInterfaceStdSomethingMockDescriptor
- type MyInterfaceMocker
- type MyInterfaceReturnSomethingAtLeastMockDescriptor
- type MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn
- func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) AtLeastTimes(times int) MyInterfaceMockDescriptor
- func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) Boring() *MyInterfaceBoringMockDescriptor
- func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) EmbeddedMethod() *MyInterfaceEmbeddedMethodMockDescriptor
- func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) Mock() (m MyInterfaceMock, assert func(t interface{ ... }) (ok bool))
- func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) ReturnSomethingAtLeast() *MyInterfaceReturnSomethingAtLeastMockDescriptor
- func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) ShouldBeFun() *MyInterfaceShouldBeFunMockDescriptor
- func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) StdSomething() *MyInterfaceStdSomethingMockDescriptor
- func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) Times(times int) MyInterfaceMockDescriptor
- func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) TimesMatching(f func(times int) error) MyInterfaceMockDescriptor
- type MyInterfaceShouldBeFunMockDescriptor
- func (d *MyInterfaceShouldBeFunMockDescriptor) Takes(a0 int, opts ...cmp.Option) MyInterfaceShouldBeFunMockDescriptorWith1Arg
- func (d *MyInterfaceShouldBeFunMockDescriptor) TakesAny() MyInterfaceShouldBeFunMockDescriptorWith1Arg
- func (d *MyInterfaceShouldBeFunMockDescriptor) TakesMatching(match func(a0 int) error) MyInterfaceShouldBeFunMockDescriptorWith1Arg
- type MyInterfaceShouldBeFunMockDescriptorWith1Arg
- func (d MyInterfaceShouldBeFunMockDescriptorWith1Arg) And(a1 map[string]map[examples.MyStruct]bool, opts ...cmp.Option) MyInterfaceShouldBeFunMockDescriptorWith2Args
- func (d MyInterfaceShouldBeFunMockDescriptorWith1Arg) AndAny() MyInterfaceShouldBeFunMockDescriptorWith2Args
- func (d MyInterfaceShouldBeFunMockDescriptorWith1Arg) AndMatching(match func(a1 map[string]map[examples.MyStruct]bool) error) MyInterfaceShouldBeFunMockDescriptorWith2Args
- type MyInterfaceShouldBeFunMockDescriptorWith2Args
- func (d MyInterfaceShouldBeFunMockDescriptorWith2Args) And(a2 []chan<- <-chan struct{}, opts ...cmp.Option) MyInterfaceShouldBeFunMockDescriptorWith3Args
- func (d MyInterfaceShouldBeFunMockDescriptorWith2Args) AndAny() MyInterfaceShouldBeFunMockDescriptorWith3Args
- func (d MyInterfaceShouldBeFunMockDescriptorWith2Args) AndMatching(match func(a2 []chan<- <-chan struct{}) error) MyInterfaceShouldBeFunMockDescriptorWith3Args
- type MyInterfaceShouldBeFunMockDescriptorWith3Args
- type MyInterfaceShouldBeFunMockDescriptorWithReturn
- func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) AtLeastTimes(times int) MyInterfaceMockDescriptor
- func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) Boring() *MyInterfaceBoringMockDescriptor
- func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) EmbeddedMethod() *MyInterfaceEmbeddedMethodMockDescriptor
- func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) Mock() (m MyInterfaceMock, assert func(t interface{ ... }) (ok bool))
- func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) ReturnSomethingAtLeast() *MyInterfaceReturnSomethingAtLeastMockDescriptor
- func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) ShouldBeFun() *MyInterfaceShouldBeFunMockDescriptor
- func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) StdSomething() *MyInterfaceStdSomethingMockDescriptor
- func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) Times(times int) MyInterfaceMockDescriptor
- func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) TimesMatching(f func(times int) error) MyInterfaceMockDescriptor
- type MyInterfaceStdSomethingMockDescriptor
- func (d *MyInterfaceStdSomethingMockDescriptor) Takes(f *os.File, opts ...cmp.Option) MyInterfaceStdSomethingMockDescriptorWith1Arg
- func (d *MyInterfaceStdSomethingMockDescriptor) TakesAny() MyInterfaceStdSomethingMockDescriptorWith1Arg
- func (d *MyInterfaceStdSomethingMockDescriptor) TakesMatching(match func(f *os.File) error) MyInterfaceStdSomethingMockDescriptorWith1Arg
- type MyInterfaceStdSomethingMockDescriptorWith1Arg
- func (d MyInterfaceStdSomethingMockDescriptorWith1Arg) And(ints []int, opts ...cmp.Option) MyInterfaceStdSomethingMockDescriptorWith2Args
- func (d MyInterfaceStdSomethingMockDescriptorWith1Arg) AndAny() MyInterfaceStdSomethingMockDescriptorWith2Args
- func (d MyInterfaceStdSomethingMockDescriptorWith1Arg) AndMatching(match func(ints []int) error) MyInterfaceStdSomethingMockDescriptorWith2Args
- type MyInterfaceStdSomethingMockDescriptorWith2Args
- type MyInterfaceStdSomethingMockDescriptorWithReturn
- func (d MyInterfaceStdSomethingMockDescriptorWithReturn) AtLeastTimes(times int) MyInterfaceMockDescriptor
- func (d MyInterfaceStdSomethingMockDescriptorWithReturn) Boring() *MyInterfaceBoringMockDescriptor
- func (d MyInterfaceStdSomethingMockDescriptorWithReturn) EmbeddedMethod() *MyInterfaceEmbeddedMethodMockDescriptor
- func (d MyInterfaceStdSomethingMockDescriptorWithReturn) Mock() (m MyInterfaceMock, assert func(t interface{ ... }) (ok bool))
- func (d MyInterfaceStdSomethingMockDescriptorWithReturn) ReturnSomethingAtLeast() *MyInterfaceReturnSomethingAtLeastMockDescriptor
- func (d MyInterfaceStdSomethingMockDescriptorWithReturn) ShouldBeFun() *MyInterfaceShouldBeFunMockDescriptor
- func (d MyInterfaceStdSomethingMockDescriptorWithReturn) StdSomething() *MyInterfaceStdSomethingMockDescriptor
- func (d MyInterfaceStdSomethingMockDescriptorWithReturn) Times(times int) MyInterfaceMockDescriptor
- func (d MyInterfaceStdSomethingMockDescriptorWithReturn) TimesMatching(f func(times int) error) MyInterfaceMockDescriptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MyFuncFuncMockDescriptor ¶ added in v0.2.0
type MyFuncFuncMockDescriptor struct {
// contains filtered or unexported fields
}
MyFuncFuncMockDescriptor is returned by MyFuncMockDescriptor.Func and holds methods to describe the mock for method MyFunc.Func.
func (*MyFuncFuncMockDescriptor) Takes ¶ added in v0.2.0
func (d *MyFuncFuncMockDescriptor) Takes(a int, opts ...cmp.Option) MyFuncFuncMockDescriptorWith1Arg
Takes lets you specify a value with which the actual value passed to the mocked method MyFunc.Func as parameter #1 will be compared.
Package "github.com/google/go-cmp/cmp" is used to do the comparison. You can pass extra options for it.
If you want to accept any value, use TakesAny.
If you want more complex validation logic, use TakesMatching.
func (*MyFuncFuncMockDescriptor) TakesAny ¶ added in v0.2.0
func (d *MyFuncFuncMockDescriptor) TakesAny() MyFuncFuncMockDescriptorWith1Arg
TakesAny declares that any value passed to the mocked method Func as parameter #1 is expected.
func (*MyFuncFuncMockDescriptor) TakesMatching ¶ added in v0.2.0
func (d *MyFuncFuncMockDescriptor) TakesMatching(match func(a int) error) MyFuncFuncMockDescriptorWith1Arg
TakesMatching lets you pass a function to accept or reject the actual value passed to the mocked method MyFunc.Func as parameter #1.
type MyFuncFuncMockDescriptorWith1Arg ¶ added in v0.2.0
type MyFuncFuncMockDescriptorWith1Arg struct {
// contains filtered or unexported fields
}
MyFuncFuncMockDescriptorWith1Arg is a step forward in the description of a way that the method MyFunc.Func is expected to be called, with 1 arguments specified.
It has methods to describe the next argument, if there's any left, or the return values, if there are any, or the times it's expected to be called otherwise.
func (MyFuncFuncMockDescriptorWith1Arg) And ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWith1Arg) And(b int, opts ...cmp.Option) MyFuncFuncMockDescriptorWith2Args
And lets you specify a value with which the actual value passed to the mocked method MyFunc.Func as parameter #2 will be compared.
Package "github.com/google/go-cmp/cmp" is used to do the comparison. You can pass extra options for it.
If you want to accept any value, use AndAny.
If you want more complex validation logic, use AndMatching.
func (MyFuncFuncMockDescriptorWith1Arg) AndAny ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWith1Arg) AndAny() MyFuncFuncMockDescriptorWith2Args
AndAny declares that any value passed to the mocked method Func as parameter #2 is expected.
func (MyFuncFuncMockDescriptorWith1Arg) AndMatching ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWith1Arg) AndMatching(match func(b int) error) MyFuncFuncMockDescriptorWith2Args
AndMatching lets you pass a function to accept or reject the actual value passed to the mocked method MyFunc.Func as parameter #2.
type MyFuncFuncMockDescriptorWith2Args ¶ added in v0.2.0
type MyFuncFuncMockDescriptorWith2Args struct {
// contains filtered or unexported fields
}
MyFuncFuncMockDescriptorWith2Args is a step forward in the description of a way that the method MyFunc.Func is expected to be called, with 2 arguments specified.
It has methods to describe the next argument, if there's any left, or the return values, if there are any, or the times it's expected to be called otherwise.
func (MyFuncFuncMockDescriptorWith2Args) And ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWith2Args) And(c int, opts ...cmp.Option) MyFuncFuncMockDescriptorWith3Args
And lets you specify a value with which the actual value passed to the mocked method MyFunc.Func as parameter #3 will be compared.
Package "github.com/google/go-cmp/cmp" is used to do the comparison. You can pass extra options for it.
If you want to accept any value, use AndAny.
If you want more complex validation logic, use AndMatching.
func (MyFuncFuncMockDescriptorWith2Args) AndAny ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWith2Args) AndAny() MyFuncFuncMockDescriptorWith3Args
AndAny declares that any value passed to the mocked method Func as parameter #3 is expected.
func (MyFuncFuncMockDescriptorWith2Args) AndMatching ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWith2Args) AndMatching(match func(c int) error) MyFuncFuncMockDescriptorWith3Args
AndMatching lets you pass a function to accept or reject the actual value passed to the mocked method MyFunc.Func as parameter #3.
type MyFuncFuncMockDescriptorWith3Args ¶ added in v0.2.0
type MyFuncFuncMockDescriptorWith3Args struct {
// contains filtered or unexported fields
}
MyFuncFuncMockDescriptorWith3Args is a step forward in the description of a way that the method MyFunc.Func is expected to be called, with 3 arguments specified.
It has methods to describe the next argument, if there's any left, or the return values, if there are any, or the times it's expected to be called otherwise.
func (MyFuncFuncMockDescriptorWith3Args) And ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWith3Args) And(x bool, opts ...cmp.Option) MyFuncFuncMockDescriptorWith4Args
And lets you specify a value with which the actual value passed to the mocked method MyFunc.Func as parameter #4 will be compared.
Package "github.com/google/go-cmp/cmp" is used to do the comparison. You can pass extra options for it.
If you want to accept any value, use AndAny.
If you want more complex validation logic, use AndMatching.
func (MyFuncFuncMockDescriptorWith3Args) AndAny ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWith3Args) AndAny() MyFuncFuncMockDescriptorWith4Args
AndAny declares that any value passed to the mocked method Func as parameter #4 is expected.
func (MyFuncFuncMockDescriptorWith3Args) AndMatching ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWith3Args) AndMatching(match func(x bool) error) MyFuncFuncMockDescriptorWith4Args
AndMatching lets you pass a function to accept or reject the actual value passed to the mocked method MyFunc.Func as parameter #4.
type MyFuncFuncMockDescriptorWith4Args ¶ added in v0.2.0
type MyFuncFuncMockDescriptorWith4Args struct {
// contains filtered or unexported fields
}
MyFuncFuncMockDescriptorWith4Args is a step forward in the description of a way that the method MyFunc.Func is expected to be called, with 4 arguments specified.
It has methods to describe the next argument, if there's any left, or the return values, if there are any, or the times it's expected to be called otherwise.
func (MyFuncFuncMockDescriptorWith4Args) And ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWith4Args) And(multi []examples.MyStruct, opts ...cmp.Option) MyFuncFuncMockDescriptorWith5Args
And lets you specify a value with which the actual value passed to the mocked method MyFunc.Func as parameter #5 will be compared.
Package "github.com/google/go-cmp/cmp" is used to do the comparison. You can pass extra options for it.
If you want to accept any value, use AndAny.
If you want more complex validation logic, use AndMatching.
func (MyFuncFuncMockDescriptorWith4Args) AndAny ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWith4Args) AndAny() MyFuncFuncMockDescriptorWith5Args
AndAny declares that any value passed to the mocked method Func as parameter #5 is expected.
func (MyFuncFuncMockDescriptorWith4Args) AndMatching ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWith4Args) AndMatching(match func(multi []examples.MyStruct) error) MyFuncFuncMockDescriptorWith5Args
AndMatching lets you pass a function to accept or reject the actual value passed to the mocked method MyFunc.Func as parameter #5.
type MyFuncFuncMockDescriptorWith5Args ¶ added in v0.2.0
type MyFuncFuncMockDescriptorWith5Args struct {
// contains filtered or unexported fields
}
MyFuncFuncMockDescriptorWith5Args is a step forward in the description of a way that the method MyFunc.Func is expected to be called, with 5 arguments specified.
It has methods to describe the next argument, if there's any left, or the return values, if there are any, or the times it's expected to be called otherwise.
func (MyFuncFuncMockDescriptorWith5Args) Returns ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWith5Args) Returns(ok bool, err error) MyFuncFuncMockDescriptorWithReturn
Returns lets you specify the values that the mocked method MyFunc.Func, if called with values matching the expectations, will return.
func (MyFuncFuncMockDescriptorWith5Args) ReturnsFrom ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWith5Args) ReturnsFrom(f func(a int, b int, c int, x bool, multi []examples.MyStruct) (ok bool, err error)) MyFuncFuncMockDescriptorWithReturn
Returns lets you specify the values that the mocked method MyFunc.Func, if called with values matching the expectations, will return.
It passes such passed values to a function that then returns the return values.
type MyFuncFuncMockDescriptorWithReturn ¶ added in v0.2.0
type MyFuncFuncMockDescriptorWithReturn struct {
// contains filtered or unexported fields
}
MyFuncFuncMockDescriptorWithReturn is a step forward in the description of a way that method MyFunc.Func is to behave when called, with all expected parameters and the resulting values specified. arguments specified.
It has methods to describe the times the method is expected to be called, or you can start another method call description, or you can call Mock to end the description and get the resulting mock.
func (MyFuncFuncMockDescriptorWithReturn) AtLeastTimes ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWithReturn) AtLeastTimes(times int) MyFuncMockDescriptor
AtLeastTimes lets you specify a minimum number of times this method is expected to be called.
func (MyFuncFuncMockDescriptorWithReturn) Func ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWithReturn) Func() *MyFuncFuncMockDescriptor
Func finishes the current description for method MyFunc.Func and starts describing for method Func.
See MyFuncMockDescriptor.Func for details.
func (MyFuncFuncMockDescriptorWithReturn) Mock ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWithReturn) Mock() (m MyFuncMock, assert func(t interface{ Errorf(string, ...interface{}) }) (ok bool))
Mock finishes the description and produces a mock.
See MyFuncMockDescriptor.Mock for details.
func (MyFuncFuncMockDescriptorWithReturn) Times ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWithReturn) Times(times int) MyFuncMockDescriptor
Times lets you specify a exact number of times this method is expected to be called.
func (MyFuncFuncMockDescriptorWithReturn) TimesMatching ¶ added in v0.2.0
func (d MyFuncFuncMockDescriptorWithReturn) TimesMatching(f func(times int) error) MyFuncMockDescriptor
TimesMatching lets you pass a function to accept or reject the number of times this method has been called.
type MyFuncMock ¶ added in v0.2.0
MyFuncMock is a mock with the same underlying type as MyFunc.
It is copied from the original just to avoid introducing a dependency on MyFunc's package.
type MyFuncMockDescriptor ¶ added in v0.2.0
type MyFuncMockDescriptor struct {
// contains filtered or unexported fields
}
A MyFuncMockDescriptor lets you describe how the methods on the resulting mock are expected to be called and what they will return.
When you're done describing methods, call its Mock method to get a mock that implements the behavior you described.
func (MyFuncMockDescriptor) Func ¶ added in v0.2.0
func (d MyFuncMockDescriptor) Func() *MyFuncFuncMockDescriptor
Func starts describing a way method MyFunc.Func is expected to be called and what it should return.
You can call it several times to describe different behaviors, each matching different parameters.
func (MyFuncMockDescriptor) Mock ¶ added in v0.2.0
func (d MyFuncMockDescriptor) Mock() (m MyFuncMock, assert func(t interface { Errorf(s string, args ...interface{}) }) (ok bool))
Mock returns a mock that the MyFunc interface, following the behavior described by the descriptor methods.
It also returns a function that should be called before the test is done to ensure that the expected number of calls to the mock methods happened. You can pass a *testing.T to it, since it implements the interface it wants.
type MyFuncMocker ¶ added in v0.2.0
type MyFuncMocker struct {
Func func(a int, b int, c int, x bool, multi ...examples.MyStruct) (ok bool, err error)
}
MyFuncMocker builds mocks for type MyFunc.
Its fields match the original type's methods. Set those you expect to be called, then call the Mock method to get a mock that implements the original type.
If the original type was a function, it is mapped to field Func.
The Describe method is a shortcut to define this struct's fields in a declarative manner.
func (*MyFuncMocker) Describe ¶ added in v0.2.0
func (m *MyFuncMocker) Describe() MyFuncMockDescriptor
Describe lets you describe how the methods on the resulting mock are expected to be called and what they will return.
When you're done describing methods, call Mock to get a mock that implements the behavior you described.
func (*MyFuncMocker) Mock ¶ added in v0.2.0
func (m *MyFuncMocker) Mock() MyFuncMock
Mock returns a mock for MyFunc that calls the functions defined as struct fields in the receiver.
You probably want to use Describe instead.
type MyInterfaceBoringMockDescriptor ¶
type MyInterfaceBoringMockDescriptor struct {
// contains filtered or unexported fields
}
MyInterfaceBoringMockDescriptor is returned by MyInterfaceMockDescriptor.Boring and holds methods to describe the mock for method MyInterface.Boring.
func (*MyInterfaceBoringMockDescriptor) AtLeastTimes ¶
func (d *MyInterfaceBoringMockDescriptor) AtLeastTimes(times int) MyInterfaceMockDescriptor
AtLeastTimes lets you specify a minimum number of times this method is expected to be called.
func (*MyInterfaceBoringMockDescriptor) Boring ¶
func (d *MyInterfaceBoringMockDescriptor) Boring() *MyInterfaceBoringMockDescriptor
Boring finishes the current description for method MyInterface.Boring and starts describing for method Boring.
See MyInterfaceMockDescriptor.Boring for details.
func (*MyInterfaceBoringMockDescriptor) EmbeddedMethod ¶
func (d *MyInterfaceBoringMockDescriptor) EmbeddedMethod() *MyInterfaceEmbeddedMethodMockDescriptor
EmbeddedMethod finishes the current description for method MyInterface.Boring and starts describing for method EmbeddedMethod.
See MyInterfaceMockDescriptor.EmbeddedMethod for details.
func (*MyInterfaceBoringMockDescriptor) Mock ¶
func (d *MyInterfaceBoringMockDescriptor) Mock() (m MyInterfaceMock, assert func(t interface{ Errorf(string, ...interface{}) }) (ok bool))
Mock finishes the description and produces a mock.
See MyInterfaceMockDescriptor.Mock for details.
func (*MyInterfaceBoringMockDescriptor) ReturnSomethingAtLeast ¶
func (d *MyInterfaceBoringMockDescriptor) ReturnSomethingAtLeast() *MyInterfaceReturnSomethingAtLeastMockDescriptor
ReturnSomethingAtLeast finishes the current description for method MyInterface.Boring and starts describing for method ReturnSomethingAtLeast.
See MyInterfaceMockDescriptor.ReturnSomethingAtLeast for details.
func (*MyInterfaceBoringMockDescriptor) ShouldBeFun ¶
func (d *MyInterfaceBoringMockDescriptor) ShouldBeFun() *MyInterfaceShouldBeFunMockDescriptor
ShouldBeFun finishes the current description for method MyInterface.Boring and starts describing for method ShouldBeFun.
See MyInterfaceMockDescriptor.ShouldBeFun for details.
func (*MyInterfaceBoringMockDescriptor) StdSomething ¶
func (d *MyInterfaceBoringMockDescriptor) StdSomething() *MyInterfaceStdSomethingMockDescriptor
StdSomething finishes the current description for method MyInterface.Boring and starts describing for method StdSomething.
See MyInterfaceMockDescriptor.StdSomething for details.
func (*MyInterfaceBoringMockDescriptor) Times ¶
func (d *MyInterfaceBoringMockDescriptor) Times(times int) MyInterfaceMockDescriptor
Times lets you specify a exact number of times this method is expected to be called.
func (*MyInterfaceBoringMockDescriptor) TimesMatching ¶
func (d *MyInterfaceBoringMockDescriptor) TimesMatching(f func(times int) error) MyInterfaceMockDescriptor
TimesMatching lets you pass a function to accept or reject the number of times this method has been called.
type MyInterfaceEmbeddedMethodMockDescriptor ¶
type MyInterfaceEmbeddedMethodMockDescriptor struct {
// contains filtered or unexported fields
}
MyInterfaceEmbeddedMethodMockDescriptor is returned by MyInterfaceMockDescriptor.EmbeddedMethod and holds methods to describe the mock for method MyInterface.EmbeddedMethod.
func (*MyInterfaceEmbeddedMethodMockDescriptor) AtLeastTimes ¶
func (d *MyInterfaceEmbeddedMethodMockDescriptor) AtLeastTimes(times int) MyInterfaceMockDescriptor
AtLeastTimes lets you specify a minimum number of times this method is expected to be called.
func (*MyInterfaceEmbeddedMethodMockDescriptor) Boring ¶
func (d *MyInterfaceEmbeddedMethodMockDescriptor) Boring() *MyInterfaceBoringMockDescriptor
Boring finishes the current description for method MyInterface.EmbeddedMethod and starts describing for method Boring.
See MyInterfaceMockDescriptor.Boring for details.
func (*MyInterfaceEmbeddedMethodMockDescriptor) EmbeddedMethod ¶
func (d *MyInterfaceEmbeddedMethodMockDescriptor) EmbeddedMethod() *MyInterfaceEmbeddedMethodMockDescriptor
EmbeddedMethod finishes the current description for method MyInterface.EmbeddedMethod and starts describing for method EmbeddedMethod.
See MyInterfaceMockDescriptor.EmbeddedMethod for details.
func (*MyInterfaceEmbeddedMethodMockDescriptor) Mock ¶
func (d *MyInterfaceEmbeddedMethodMockDescriptor) Mock() (m MyInterfaceMock, assert func(t interface{ Errorf(string, ...interface{}) }) (ok bool))
Mock finishes the description and produces a mock.
See MyInterfaceMockDescriptor.Mock for details.
func (*MyInterfaceEmbeddedMethodMockDescriptor) ReturnSomethingAtLeast ¶
func (d *MyInterfaceEmbeddedMethodMockDescriptor) ReturnSomethingAtLeast() *MyInterfaceReturnSomethingAtLeastMockDescriptor
ReturnSomethingAtLeast finishes the current description for method MyInterface.EmbeddedMethod and starts describing for method ReturnSomethingAtLeast.
See MyInterfaceMockDescriptor.ReturnSomethingAtLeast for details.
func (*MyInterfaceEmbeddedMethodMockDescriptor) ShouldBeFun ¶
func (d *MyInterfaceEmbeddedMethodMockDescriptor) ShouldBeFun() *MyInterfaceShouldBeFunMockDescriptor
ShouldBeFun finishes the current description for method MyInterface.EmbeddedMethod and starts describing for method ShouldBeFun.
See MyInterfaceMockDescriptor.ShouldBeFun for details.
func (*MyInterfaceEmbeddedMethodMockDescriptor) StdSomething ¶
func (d *MyInterfaceEmbeddedMethodMockDescriptor) StdSomething() *MyInterfaceStdSomethingMockDescriptor
StdSomething finishes the current description for method MyInterface.EmbeddedMethod and starts describing for method StdSomething.
See MyInterfaceMockDescriptor.StdSomething for details.
func (*MyInterfaceEmbeddedMethodMockDescriptor) Times ¶
func (d *MyInterfaceEmbeddedMethodMockDescriptor) Times(times int) MyInterfaceMockDescriptor
Times lets you specify a exact number of times this method is expected to be called.
func (*MyInterfaceEmbeddedMethodMockDescriptor) TimesMatching ¶
func (d *MyInterfaceEmbeddedMethodMockDescriptor) TimesMatching(f func(times int) error) MyInterfaceMockDescriptor
TimesMatching lets you pass a function to accept or reject the number of times this method has been called.
type MyInterfaceMock ¶
type MyInterfaceMock interface { Boring() EmbeddedMethod() ReturnSomethingAtLeast() (r0 int) ShouldBeFun(a0 int, a1 map[string]map[examples.MyStruct]bool, a2 ...chan<- <-chan struct{}) (r0 int, r1 error) StdSomething(f *os.File, ints ...int) (named bool) }
MyInterfaceMock is a mock with the same underlying type as MyInterface.
It is copied from the original just to avoid introducing a dependency on MyInterface's package.
type MyInterfaceMockDescriptor ¶
type MyInterfaceMockDescriptor struct {
// contains filtered or unexported fields
}
A MyInterfaceMockDescriptor lets you describe how the methods on the resulting mock are expected to be called and what they will return.
When you're done describing methods, call its Mock method to get a mock that implements the behavior you described.
func (MyInterfaceMockDescriptor) Boring ¶
func (d MyInterfaceMockDescriptor) Boring() *MyInterfaceBoringMockDescriptor
Boring starts describing a way method MyInterface.Boring is expected to be called and what it should return.
You can call it several times to describe different behaviors, each matching different parameters.
func (MyInterfaceMockDescriptor) EmbeddedMethod ¶
func (d MyInterfaceMockDescriptor) EmbeddedMethod() *MyInterfaceEmbeddedMethodMockDescriptor
EmbeddedMethod starts describing a way method MyInterface.EmbeddedMethod is expected to be called and what it should return.
You can call it several times to describe different behaviors, each matching different parameters.
func (MyInterfaceMockDescriptor) Mock ¶
func (d MyInterfaceMockDescriptor) Mock() (m MyInterfaceMock, assert func(t interface { Errorf(s string, args ...interface{}) }) (ok bool))
Mock returns a mock that the MyInterface interface, following the behavior described by the descriptor methods.
It also returns a function that should be called before the test is done to ensure that the expected number of calls to the mock methods happened. You can pass a *testing.T to it, since it implements the interface it wants.
func (MyInterfaceMockDescriptor) ReturnSomethingAtLeast ¶
func (d MyInterfaceMockDescriptor) ReturnSomethingAtLeast() *MyInterfaceReturnSomethingAtLeastMockDescriptor
ReturnSomethingAtLeast starts describing a way method MyInterface.ReturnSomethingAtLeast is expected to be called and what it should return.
You can call it several times to describe different behaviors, each matching different parameters.
func (MyInterfaceMockDescriptor) ShouldBeFun ¶
func (d MyInterfaceMockDescriptor) ShouldBeFun() *MyInterfaceShouldBeFunMockDescriptor
ShouldBeFun starts describing a way method MyInterface.ShouldBeFun is expected to be called and what it should return.
You can call it several times to describe different behaviors, each matching different parameters.
func (MyInterfaceMockDescriptor) StdSomething ¶
func (d MyInterfaceMockDescriptor) StdSomething() *MyInterfaceStdSomethingMockDescriptor
StdSomething starts describing a way method MyInterface.StdSomething is expected to be called and what it should return.
You can call it several times to describe different behaviors, each matching different parameters.
type MyInterfaceMocker ¶
type MyInterfaceMocker struct { Boring func() EmbeddedMethod func() ReturnSomethingAtLeast func() (r0 int) ShouldBeFun func(a0 int, a1 map[string]map[examples.MyStruct]bool, a2 ...chan<- <-chan struct{}) (r0 int, r1 error) StdSomething func(f *os.File, ints ...int) (named bool) }
MyInterfaceMocker builds mocks for type MyInterface.
Its fields match the original type's methods. Set those you expect to be called, then call the Mock method to get a mock that implements the original type.
If the original type was a function, it is mapped to field Func.
The Describe method is a shortcut to define this struct's fields in a declarative manner.
func (*MyInterfaceMocker) Describe ¶
func (m *MyInterfaceMocker) Describe() MyInterfaceMockDescriptor
Describe lets you describe how the methods on the resulting mock are expected to be called and what they will return.
When you're done describing methods, call Mock to get a mock that implements the behavior you described.
func (*MyInterfaceMocker) Mock ¶
func (m *MyInterfaceMocker) Mock() MyInterfaceMock
Mock returns a mock for MyInterface that calls the functions defined as struct fields in the receiver.
You probably want to use Describe instead.
type MyInterfaceReturnSomethingAtLeastMockDescriptor ¶
type MyInterfaceReturnSomethingAtLeastMockDescriptor struct {
// contains filtered or unexported fields
}
MyInterfaceReturnSomethingAtLeastMockDescriptor is returned by MyInterfaceMockDescriptor.ReturnSomethingAtLeast and holds methods to describe the mock for method MyInterface.ReturnSomethingAtLeast.
func (*MyInterfaceReturnSomethingAtLeastMockDescriptor) Returns ¶
func (d *MyInterfaceReturnSomethingAtLeastMockDescriptor) Returns(r0 int) MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn
Returns lets you specify the values that the mocked method MyInterface.ReturnSomethingAtLeast, if called with values matching the expectations, will return.
func (*MyInterfaceReturnSomethingAtLeastMockDescriptor) ReturnsFrom ¶
func (d *MyInterfaceReturnSomethingAtLeastMockDescriptor) ReturnsFrom(f func() (r0 int)) MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn
Returns lets you specify the values that the mocked method MyInterface.ReturnSomethingAtLeast, if called with values matching the expectations, will return.
It passes such passed values to a function that then returns the return values.
type MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn ¶
type MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn struct {
// contains filtered or unexported fields
}
MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn is a step forward in the description of a way that method MyInterface.ReturnSomethingAtLeast is to behave when called, with all expected parameters and the resulting values specified. arguments specified.
It has methods to describe the times the method is expected to be called, or you can start another method call description, or you can call Mock to end the description and get the resulting mock.
func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) AtLeastTimes ¶
func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) AtLeastTimes(times int) MyInterfaceMockDescriptor
AtLeastTimes lets you specify a minimum number of times this method is expected to be called.
func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) Boring ¶
func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) Boring() *MyInterfaceBoringMockDescriptor
Boring finishes the current description for method MyInterface.ReturnSomethingAtLeast and starts describing for method Boring.
See MyInterfaceMockDescriptor.Boring for details.
func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) EmbeddedMethod ¶
func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) EmbeddedMethod() *MyInterfaceEmbeddedMethodMockDescriptor
EmbeddedMethod finishes the current description for method MyInterface.ReturnSomethingAtLeast and starts describing for method EmbeddedMethod.
See MyInterfaceMockDescriptor.EmbeddedMethod for details.
func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) Mock ¶
func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) Mock() (m MyInterfaceMock, assert func(t interface{ Errorf(string, ...interface{}) }) (ok bool))
Mock finishes the description and produces a mock.
See MyInterfaceMockDescriptor.Mock for details.
func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) ReturnSomethingAtLeast ¶
func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) ReturnSomethingAtLeast() *MyInterfaceReturnSomethingAtLeastMockDescriptor
ReturnSomethingAtLeast finishes the current description for method MyInterface.ReturnSomethingAtLeast and starts describing for method ReturnSomethingAtLeast.
See MyInterfaceMockDescriptor.ReturnSomethingAtLeast for details.
func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) ShouldBeFun ¶
func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) ShouldBeFun() *MyInterfaceShouldBeFunMockDescriptor
ShouldBeFun finishes the current description for method MyInterface.ReturnSomethingAtLeast and starts describing for method ShouldBeFun.
See MyInterfaceMockDescriptor.ShouldBeFun for details.
func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) StdSomething ¶
func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) StdSomething() *MyInterfaceStdSomethingMockDescriptor
StdSomething finishes the current description for method MyInterface.ReturnSomethingAtLeast and starts describing for method StdSomething.
See MyInterfaceMockDescriptor.StdSomething for details.
func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) Times ¶
func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) Times(times int) MyInterfaceMockDescriptor
Times lets you specify a exact number of times this method is expected to be called.
func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) TimesMatching ¶
func (d MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) TimesMatching(f func(times int) error) MyInterfaceMockDescriptor
TimesMatching lets you pass a function to accept or reject the number of times this method has been called.
type MyInterfaceShouldBeFunMockDescriptor ¶
type MyInterfaceShouldBeFunMockDescriptor struct {
// contains filtered or unexported fields
}
MyInterfaceShouldBeFunMockDescriptor is returned by MyInterfaceMockDescriptor.ShouldBeFun and holds methods to describe the mock for method MyInterface.ShouldBeFun.
func (*MyInterfaceShouldBeFunMockDescriptor) Takes ¶
func (d *MyInterfaceShouldBeFunMockDescriptor) Takes(a0 int, opts ...cmp.Option) MyInterfaceShouldBeFunMockDescriptorWith1Arg
Takes lets you specify a value with which the actual value passed to the mocked method MyInterface.ShouldBeFun as parameter #1 will be compared.
Package "github.com/google/go-cmp/cmp" is used to do the comparison. You can pass extra options for it.
If you want to accept any value, use TakesAny.
If you want more complex validation logic, use TakesMatching.
func (*MyInterfaceShouldBeFunMockDescriptor) TakesAny ¶
func (d *MyInterfaceShouldBeFunMockDescriptor) TakesAny() MyInterfaceShouldBeFunMockDescriptorWith1Arg
TakesAny declares that any value passed to the mocked method ShouldBeFun as parameter #1 is expected.
func (*MyInterfaceShouldBeFunMockDescriptor) TakesMatching ¶
func (d *MyInterfaceShouldBeFunMockDescriptor) TakesMatching(match func(a0 int) error) MyInterfaceShouldBeFunMockDescriptorWith1Arg
TakesMatching lets you pass a function to accept or reject the actual value passed to the mocked method MyInterface.ShouldBeFun as parameter #1.
type MyInterfaceShouldBeFunMockDescriptorWith1Arg ¶
type MyInterfaceShouldBeFunMockDescriptorWith1Arg struct {
// contains filtered or unexported fields
}
MyInterfaceShouldBeFunMockDescriptorWith1Arg is a step forward in the description of a way that the method MyInterface.ShouldBeFun is expected to be called, with 1 arguments specified.
It has methods to describe the next argument, if there's any left, or the return values, if there are any, or the times it's expected to be called otherwise.
func (MyInterfaceShouldBeFunMockDescriptorWith1Arg) And ¶
func (d MyInterfaceShouldBeFunMockDescriptorWith1Arg) And(a1 map[string]map[examples.MyStruct]bool, opts ...cmp.Option) MyInterfaceShouldBeFunMockDescriptorWith2Args
And lets you specify a value with which the actual value passed to the mocked method MyInterface.ShouldBeFun as parameter #2 will be compared.
Package "github.com/google/go-cmp/cmp" is used to do the comparison. You can pass extra options for it.
If you want to accept any value, use AndAny.
If you want more complex validation logic, use AndMatching.
func (MyInterfaceShouldBeFunMockDescriptorWith1Arg) AndAny ¶
func (d MyInterfaceShouldBeFunMockDescriptorWith1Arg) AndAny() MyInterfaceShouldBeFunMockDescriptorWith2Args
AndAny declares that any value passed to the mocked method ShouldBeFun as parameter #2 is expected.
func (MyInterfaceShouldBeFunMockDescriptorWith1Arg) AndMatching ¶
func (d MyInterfaceShouldBeFunMockDescriptorWith1Arg) AndMatching(match func(a1 map[string]map[examples.MyStruct]bool) error) MyInterfaceShouldBeFunMockDescriptorWith2Args
AndMatching lets you pass a function to accept or reject the actual value passed to the mocked method MyInterface.ShouldBeFun as parameter #2.
type MyInterfaceShouldBeFunMockDescriptorWith2Args ¶
type MyInterfaceShouldBeFunMockDescriptorWith2Args struct {
// contains filtered or unexported fields
}
MyInterfaceShouldBeFunMockDescriptorWith2Args is a step forward in the description of a way that the method MyInterface.ShouldBeFun is expected to be called, with 2 arguments specified.
It has methods to describe the next argument, if there's any left, or the return values, if there are any, or the times it's expected to be called otherwise.
func (MyInterfaceShouldBeFunMockDescriptorWith2Args) And ¶
func (d MyInterfaceShouldBeFunMockDescriptorWith2Args) And(a2 []chan<- <-chan struct{}, opts ...cmp.Option) MyInterfaceShouldBeFunMockDescriptorWith3Args
And lets you specify a value with which the actual value passed to the mocked method MyInterface.ShouldBeFun as parameter #3 will be compared.
Package "github.com/google/go-cmp/cmp" is used to do the comparison. You can pass extra options for it.
If you want to accept any value, use AndAny.
If you want more complex validation logic, use AndMatching.
func (MyInterfaceShouldBeFunMockDescriptorWith2Args) AndAny ¶
func (d MyInterfaceShouldBeFunMockDescriptorWith2Args) AndAny() MyInterfaceShouldBeFunMockDescriptorWith3Args
AndAny declares that any value passed to the mocked method ShouldBeFun as parameter #3 is expected.
func (MyInterfaceShouldBeFunMockDescriptorWith2Args) AndMatching ¶
func (d MyInterfaceShouldBeFunMockDescriptorWith2Args) AndMatching(match func(a2 []chan<- <-chan struct{}) error) MyInterfaceShouldBeFunMockDescriptorWith3Args
AndMatching lets you pass a function to accept or reject the actual value passed to the mocked method MyInterface.ShouldBeFun as parameter #3.
type MyInterfaceShouldBeFunMockDescriptorWith3Args ¶
type MyInterfaceShouldBeFunMockDescriptorWith3Args struct {
// contains filtered or unexported fields
}
MyInterfaceShouldBeFunMockDescriptorWith3Args is a step forward in the description of a way that the method MyInterface.ShouldBeFun is expected to be called, with 3 arguments specified.
It has methods to describe the next argument, if there's any left, or the return values, if there are any, or the times it's expected to be called otherwise.
func (MyInterfaceShouldBeFunMockDescriptorWith3Args) Returns ¶
func (d MyInterfaceShouldBeFunMockDescriptorWith3Args) Returns(r0 int, r1 error) MyInterfaceShouldBeFunMockDescriptorWithReturn
Returns lets you specify the values that the mocked method MyInterface.ShouldBeFun, if called with values matching the expectations, will return.
func (MyInterfaceShouldBeFunMockDescriptorWith3Args) ReturnsFrom ¶
func (d MyInterfaceShouldBeFunMockDescriptorWith3Args) ReturnsFrom(f func(a0 int, a1 map[string]map[examples.MyStruct]bool, a2 []chan<- <-chan struct{}) (r0 int, r1 error)) MyInterfaceShouldBeFunMockDescriptorWithReturn
Returns lets you specify the values that the mocked method MyInterface.ShouldBeFun, if called with values matching the expectations, will return.
It passes such passed values to a function that then returns the return values.
type MyInterfaceShouldBeFunMockDescriptorWithReturn ¶
type MyInterfaceShouldBeFunMockDescriptorWithReturn struct {
// contains filtered or unexported fields
}
MyInterfaceShouldBeFunMockDescriptorWithReturn is a step forward in the description of a way that method MyInterface.ShouldBeFun is to behave when called, with all expected parameters and the resulting values specified. arguments specified.
It has methods to describe the times the method is expected to be called, or you can start another method call description, or you can call Mock to end the description and get the resulting mock.
func (MyInterfaceShouldBeFunMockDescriptorWithReturn) AtLeastTimes ¶
func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) AtLeastTimes(times int) MyInterfaceMockDescriptor
AtLeastTimes lets you specify a minimum number of times this method is expected to be called.
func (MyInterfaceShouldBeFunMockDescriptorWithReturn) Boring ¶
func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) Boring() *MyInterfaceBoringMockDescriptor
Boring finishes the current description for method MyInterface.ShouldBeFun and starts describing for method Boring.
See MyInterfaceMockDescriptor.Boring for details.
func (MyInterfaceShouldBeFunMockDescriptorWithReturn) EmbeddedMethod ¶
func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) EmbeddedMethod() *MyInterfaceEmbeddedMethodMockDescriptor
EmbeddedMethod finishes the current description for method MyInterface.ShouldBeFun and starts describing for method EmbeddedMethod.
See MyInterfaceMockDescriptor.EmbeddedMethod for details.
func (MyInterfaceShouldBeFunMockDescriptorWithReturn) Mock ¶
func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) Mock() (m MyInterfaceMock, assert func(t interface{ Errorf(string, ...interface{}) }) (ok bool))
Mock finishes the description and produces a mock.
See MyInterfaceMockDescriptor.Mock for details.
func (MyInterfaceShouldBeFunMockDescriptorWithReturn) ReturnSomethingAtLeast ¶
func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) ReturnSomethingAtLeast() *MyInterfaceReturnSomethingAtLeastMockDescriptor
ReturnSomethingAtLeast finishes the current description for method MyInterface.ShouldBeFun and starts describing for method ReturnSomethingAtLeast.
See MyInterfaceMockDescriptor.ReturnSomethingAtLeast for details.
func (MyInterfaceShouldBeFunMockDescriptorWithReturn) ShouldBeFun ¶
func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) ShouldBeFun() *MyInterfaceShouldBeFunMockDescriptor
ShouldBeFun finishes the current description for method MyInterface.ShouldBeFun and starts describing for method ShouldBeFun.
See MyInterfaceMockDescriptor.ShouldBeFun for details.
func (MyInterfaceShouldBeFunMockDescriptorWithReturn) StdSomething ¶
func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) StdSomething() *MyInterfaceStdSomethingMockDescriptor
StdSomething finishes the current description for method MyInterface.ShouldBeFun and starts describing for method StdSomething.
See MyInterfaceMockDescriptor.StdSomething for details.
func (MyInterfaceShouldBeFunMockDescriptorWithReturn) Times ¶
func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) Times(times int) MyInterfaceMockDescriptor
Times lets you specify a exact number of times this method is expected to be called.
func (MyInterfaceShouldBeFunMockDescriptorWithReturn) TimesMatching ¶
func (d MyInterfaceShouldBeFunMockDescriptorWithReturn) TimesMatching(f func(times int) error) MyInterfaceMockDescriptor
TimesMatching lets you pass a function to accept or reject the number of times this method has been called.
type MyInterfaceStdSomethingMockDescriptor ¶
type MyInterfaceStdSomethingMockDescriptor struct {
// contains filtered or unexported fields
}
MyInterfaceStdSomethingMockDescriptor is returned by MyInterfaceMockDescriptor.StdSomething and holds methods to describe the mock for method MyInterface.StdSomething.
func (*MyInterfaceStdSomethingMockDescriptor) Takes ¶
func (d *MyInterfaceStdSomethingMockDescriptor) Takes(f *os.File, opts ...cmp.Option) MyInterfaceStdSomethingMockDescriptorWith1Arg
Takes lets you specify a value with which the actual value passed to the mocked method MyInterface.StdSomething as parameter #1 will be compared.
Package "github.com/google/go-cmp/cmp" is used to do the comparison. You can pass extra options for it.
If you want to accept any value, use TakesAny.
If you want more complex validation logic, use TakesMatching.
func (*MyInterfaceStdSomethingMockDescriptor) TakesAny ¶
func (d *MyInterfaceStdSomethingMockDescriptor) TakesAny() MyInterfaceStdSomethingMockDescriptorWith1Arg
TakesAny declares that any value passed to the mocked method StdSomething as parameter #1 is expected.
func (*MyInterfaceStdSomethingMockDescriptor) TakesMatching ¶
func (d *MyInterfaceStdSomethingMockDescriptor) TakesMatching(match func(f *os.File) error) MyInterfaceStdSomethingMockDescriptorWith1Arg
TakesMatching lets you pass a function to accept or reject the actual value passed to the mocked method MyInterface.StdSomething as parameter #1.
type MyInterfaceStdSomethingMockDescriptorWith1Arg ¶
type MyInterfaceStdSomethingMockDescriptorWith1Arg struct {
// contains filtered or unexported fields
}
MyInterfaceStdSomethingMockDescriptorWith1Arg is a step forward in the description of a way that the method MyInterface.StdSomething is expected to be called, with 1 arguments specified.
It has methods to describe the next argument, if there's any left, or the return values, if there are any, or the times it's expected to be called otherwise.
func (MyInterfaceStdSomethingMockDescriptorWith1Arg) And ¶
func (d MyInterfaceStdSomethingMockDescriptorWith1Arg) And(ints []int, opts ...cmp.Option) MyInterfaceStdSomethingMockDescriptorWith2Args
And lets you specify a value with which the actual value passed to the mocked method MyInterface.StdSomething as parameter #2 will be compared.
Package "github.com/google/go-cmp/cmp" is used to do the comparison. You can pass extra options for it.
If you want to accept any value, use AndAny.
If you want more complex validation logic, use AndMatching.
func (MyInterfaceStdSomethingMockDescriptorWith1Arg) AndAny ¶
func (d MyInterfaceStdSomethingMockDescriptorWith1Arg) AndAny() MyInterfaceStdSomethingMockDescriptorWith2Args
AndAny declares that any value passed to the mocked method StdSomething as parameter #2 is expected.
func (MyInterfaceStdSomethingMockDescriptorWith1Arg) AndMatching ¶
func (d MyInterfaceStdSomethingMockDescriptorWith1Arg) AndMatching(match func(ints []int) error) MyInterfaceStdSomethingMockDescriptorWith2Args
AndMatching lets you pass a function to accept or reject the actual value passed to the mocked method MyInterface.StdSomething as parameter #2.
type MyInterfaceStdSomethingMockDescriptorWith2Args ¶
type MyInterfaceStdSomethingMockDescriptorWith2Args struct {
// contains filtered or unexported fields
}
MyInterfaceStdSomethingMockDescriptorWith2Args is a step forward in the description of a way that the method MyInterface.StdSomething is expected to be called, with 2 arguments specified.
It has methods to describe the next argument, if there's any left, or the return values, if there are any, or the times it's expected to be called otherwise.
func (MyInterfaceStdSomethingMockDescriptorWith2Args) Returns ¶
func (d MyInterfaceStdSomethingMockDescriptorWith2Args) Returns(named bool) MyInterfaceStdSomethingMockDescriptorWithReturn
Returns lets you specify the values that the mocked method MyInterface.StdSomething, if called with values matching the expectations, will return.
func (MyInterfaceStdSomethingMockDescriptorWith2Args) ReturnsFrom ¶
func (d MyInterfaceStdSomethingMockDescriptorWith2Args) ReturnsFrom(f func(f *os.File, ints []int) (named bool)) MyInterfaceStdSomethingMockDescriptorWithReturn
Returns lets you specify the values that the mocked method MyInterface.StdSomething, if called with values matching the expectations, will return.
It passes such passed values to a function that then returns the return values.
type MyInterfaceStdSomethingMockDescriptorWithReturn ¶
type MyInterfaceStdSomethingMockDescriptorWithReturn struct {
// contains filtered or unexported fields
}
MyInterfaceStdSomethingMockDescriptorWithReturn is a step forward in the description of a way that method MyInterface.StdSomething is to behave when called, with all expected parameters and the resulting values specified. arguments specified.
It has methods to describe the times the method is expected to be called, or you can start another method call description, or you can call Mock to end the description and get the resulting mock.
func (MyInterfaceStdSomethingMockDescriptorWithReturn) AtLeastTimes ¶
func (d MyInterfaceStdSomethingMockDescriptorWithReturn) AtLeastTimes(times int) MyInterfaceMockDescriptor
AtLeastTimes lets you specify a minimum number of times this method is expected to be called.
func (MyInterfaceStdSomethingMockDescriptorWithReturn) Boring ¶
func (d MyInterfaceStdSomethingMockDescriptorWithReturn) Boring() *MyInterfaceBoringMockDescriptor
Boring finishes the current description for method MyInterface.StdSomething and starts describing for method Boring.
See MyInterfaceMockDescriptor.Boring for details.
func (MyInterfaceStdSomethingMockDescriptorWithReturn) EmbeddedMethod ¶
func (d MyInterfaceStdSomethingMockDescriptorWithReturn) EmbeddedMethod() *MyInterfaceEmbeddedMethodMockDescriptor
EmbeddedMethod finishes the current description for method MyInterface.StdSomething and starts describing for method EmbeddedMethod.
See MyInterfaceMockDescriptor.EmbeddedMethod for details.
func (MyInterfaceStdSomethingMockDescriptorWithReturn) Mock ¶
func (d MyInterfaceStdSomethingMockDescriptorWithReturn) Mock() (m MyInterfaceMock, assert func(t interface{ Errorf(string, ...interface{}) }) (ok bool))
Mock finishes the description and produces a mock.
See MyInterfaceMockDescriptor.Mock for details.
func (MyInterfaceStdSomethingMockDescriptorWithReturn) ReturnSomethingAtLeast ¶
func (d MyInterfaceStdSomethingMockDescriptorWithReturn) ReturnSomethingAtLeast() *MyInterfaceReturnSomethingAtLeastMockDescriptor
ReturnSomethingAtLeast finishes the current description for method MyInterface.StdSomething and starts describing for method ReturnSomethingAtLeast.
See MyInterfaceMockDescriptor.ReturnSomethingAtLeast for details.
func (MyInterfaceStdSomethingMockDescriptorWithReturn) ShouldBeFun ¶
func (d MyInterfaceStdSomethingMockDescriptorWithReturn) ShouldBeFun() *MyInterfaceShouldBeFunMockDescriptor
ShouldBeFun finishes the current description for method MyInterface.StdSomething and starts describing for method ShouldBeFun.
See MyInterfaceMockDescriptor.ShouldBeFun for details.
func (MyInterfaceStdSomethingMockDescriptorWithReturn) StdSomething ¶
func (d MyInterfaceStdSomethingMockDescriptorWithReturn) StdSomething() *MyInterfaceStdSomethingMockDescriptor
StdSomething finishes the current description for method MyInterface.StdSomething and starts describing for method StdSomething.
See MyInterfaceMockDescriptor.StdSomething for details.
func (MyInterfaceStdSomethingMockDescriptorWithReturn) Times ¶
func (d MyInterfaceStdSomethingMockDescriptorWithReturn) Times(times int) MyInterfaceMockDescriptor
Times lets you specify a exact number of times this method is expected to be called.
func (MyInterfaceStdSomethingMockDescriptorWithReturn) TimesMatching ¶
func (d MyInterfaceStdSomethingMockDescriptorWithReturn) TimesMatching(f func(times int) error) MyInterfaceMockDescriptor
TimesMatching lets you pass a function to accept or reject the number of times this method has been called.