generated

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2019 License: MIT Imports: 5 Imported by: 0

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

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

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

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

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

AndAny declares that any value passed to the mocked method Func as parameter #2 is expected.

func (MyFuncFuncMockDescriptorWith1Arg) AndMatching added in v0.2.0

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

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

AndAny declares that any value passed to the mocked method Func as parameter #3 is expected.

func (MyFuncFuncMockDescriptorWith2Args) AndMatching added in v0.2.0

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

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

AndAny declares that any value passed to the mocked method Func as parameter #4 is expected.

func (MyFuncFuncMockDescriptorWith3Args) AndMatching added in v0.2.0

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

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

AndAny declares that any value passed to the mocked method Func as parameter #5 is expected.

func (MyFuncFuncMockDescriptorWith4Args) AndMatching added in v0.2.0

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

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

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 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

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

type MyFuncMock func(a int, b int, c int, x bool, multi ...examples.MyStruct) (ok bool, err error)

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 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

AtLeastTimes lets you specify a minimum number of times this method is expected to be called.

func (*MyInterfaceBoringMockDescriptor) Boring

Boring finishes the current description for method MyInterface.Boring and starts describing for method Boring.

See MyInterfaceMockDescriptor.Boring for details.

func (*MyInterfaceBoringMockDescriptor) EmbeddedMethod

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

ReturnSomethingAtLeast finishes the current description for method MyInterface.Boring and starts describing for method ReturnSomethingAtLeast.

See MyInterfaceMockDescriptor.ReturnSomethingAtLeast for details.

func (*MyInterfaceBoringMockDescriptor) ShouldBeFun

ShouldBeFun finishes the current description for method MyInterface.Boring and starts describing for method ShouldBeFun.

See MyInterfaceMockDescriptor.ShouldBeFun for details.

func (*MyInterfaceBoringMockDescriptor) StdSomething

StdSomething finishes the current description for method MyInterface.Boring and starts describing for method StdSomething.

See MyInterfaceMockDescriptor.StdSomething for details.

func (*MyInterfaceBoringMockDescriptor) Times

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

AtLeastTimes lets you specify a minimum number of times this method is expected to be called.

func (*MyInterfaceEmbeddedMethodMockDescriptor) Boring

Boring finishes the current description for method MyInterface.EmbeddedMethod and starts describing for method Boring.

See MyInterfaceMockDescriptor.Boring for details.

func (*MyInterfaceEmbeddedMethodMockDescriptor) EmbeddedMethod

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

ReturnSomethingAtLeast finishes the current description for method MyInterface.EmbeddedMethod and starts describing for method ReturnSomethingAtLeast.

See MyInterfaceMockDescriptor.ReturnSomethingAtLeast for details.

func (*MyInterfaceEmbeddedMethodMockDescriptor) ShouldBeFun

ShouldBeFun finishes the current description for method MyInterface.EmbeddedMethod and starts describing for method ShouldBeFun.

See MyInterfaceMockDescriptor.ShouldBeFun for details.

func (*MyInterfaceEmbeddedMethodMockDescriptor) StdSomething

StdSomething finishes the current description for method MyInterface.EmbeddedMethod and starts describing for method StdSomething.

See MyInterfaceMockDescriptor.StdSomething for details.

func (*MyInterfaceEmbeddedMethodMockDescriptor) Times

Times lets you specify a exact number of times this method is expected to be called.

func (*MyInterfaceEmbeddedMethodMockDescriptor) TimesMatching

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

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

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

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

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

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

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

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

Returns lets you specify the values that the mocked method MyInterface.ReturnSomethingAtLeast, if called with values matching the expectations, will return.

func (*MyInterfaceReturnSomethingAtLeastMockDescriptor) ReturnsFrom

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

AtLeastTimes lets you specify a minimum number of times this method is expected to be called.

func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) Boring

Boring finishes the current description for method MyInterface.ReturnSomethingAtLeast and starts describing for method Boring.

See MyInterfaceMockDescriptor.Boring for details.

func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) EmbeddedMethod

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

ReturnSomethingAtLeast finishes the current description for method MyInterface.ReturnSomethingAtLeast and starts describing for method ReturnSomethingAtLeast.

See MyInterfaceMockDescriptor.ReturnSomethingAtLeast for details.

func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) ShouldBeFun

ShouldBeFun finishes the current description for method MyInterface.ReturnSomethingAtLeast and starts describing for method ShouldBeFun.

See MyInterfaceMockDescriptor.ShouldBeFun for details.

func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) StdSomething

StdSomething finishes the current description for method MyInterface.ReturnSomethingAtLeast and starts describing for method StdSomething.

See MyInterfaceMockDescriptor.StdSomething for details.

func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) Times

Times lets you specify a exact number of times this method is expected to be called.

func (MyInterfaceReturnSomethingAtLeastMockDescriptorWithReturn) TimesMatching

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

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

TakesAny declares that any value passed to the mocked method ShouldBeFun as parameter #1 is expected.

func (*MyInterfaceShouldBeFunMockDescriptor) TakesMatching

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

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

AndAny declares that any value passed to the mocked method ShouldBeFun as parameter #2 is expected.

func (MyInterfaceShouldBeFunMockDescriptorWith1Arg) AndMatching

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

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

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

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

AtLeastTimes lets you specify a minimum number of times this method is expected to be called.

func (MyInterfaceShouldBeFunMockDescriptorWithReturn) Boring

Boring finishes the current description for method MyInterface.ShouldBeFun and starts describing for method Boring.

See MyInterfaceMockDescriptor.Boring for details.

func (MyInterfaceShouldBeFunMockDescriptorWithReturn) EmbeddedMethod

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

ReturnSomethingAtLeast finishes the current description for method MyInterface.ShouldBeFun and starts describing for method ReturnSomethingAtLeast.

See MyInterfaceMockDescriptor.ReturnSomethingAtLeast for details.

func (MyInterfaceShouldBeFunMockDescriptorWithReturn) ShouldBeFun

ShouldBeFun finishes the current description for method MyInterface.ShouldBeFun and starts describing for method ShouldBeFun.

See MyInterfaceMockDescriptor.ShouldBeFun for details.

func (MyInterfaceShouldBeFunMockDescriptorWithReturn) StdSomething

StdSomething finishes the current description for method MyInterface.ShouldBeFun and starts describing for method StdSomething.

See MyInterfaceMockDescriptor.StdSomething for details.

func (MyInterfaceShouldBeFunMockDescriptorWithReturn) Times

Times lets you specify a exact number of times this method is expected to be called.

func (MyInterfaceShouldBeFunMockDescriptorWithReturn) TimesMatching

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

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

TakesAny declares that any value passed to the mocked method StdSomething as parameter #1 is expected.

func (*MyInterfaceStdSomethingMockDescriptor) TakesMatching

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

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

AndAny declares that any value passed to the mocked method StdSomething as parameter #2 is expected.

func (MyInterfaceStdSomethingMockDescriptorWith1Arg) AndMatching

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

Returns lets you specify the values that the mocked method MyInterface.StdSomething, if called with values matching the expectations, will return.

func (MyInterfaceStdSomethingMockDescriptorWith2Args) ReturnsFrom

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

AtLeastTimes lets you specify a minimum number of times this method is expected to be called.

func (MyInterfaceStdSomethingMockDescriptorWithReturn) Boring

Boring finishes the current description for method MyInterface.StdSomething and starts describing for method Boring.

See MyInterfaceMockDescriptor.Boring for details.

func (MyInterfaceStdSomethingMockDescriptorWithReturn) EmbeddedMethod

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

ReturnSomethingAtLeast finishes the current description for method MyInterface.StdSomething and starts describing for method ReturnSomethingAtLeast.

See MyInterfaceMockDescriptor.ReturnSomethingAtLeast for details.

func (MyInterfaceStdSomethingMockDescriptorWithReturn) ShouldBeFun

ShouldBeFun finishes the current description for method MyInterface.StdSomething and starts describing for method ShouldBeFun.

See MyInterfaceMockDescriptor.ShouldBeFun for details.

func (MyInterfaceStdSomethingMockDescriptorWithReturn) StdSomething

StdSomething finishes the current description for method MyInterface.StdSomething and starts describing for method StdSomething.

See MyInterfaceMockDescriptor.StdSomething for details.

func (MyInterfaceStdSomethingMockDescriptorWithReturn) Times

Times lets you specify a exact number of times this method is expected to be called.

func (MyInterfaceStdSomethingMockDescriptorWithReturn) TimesMatching

TimesMatching lets you pass a function to accept or reject the number of times this method has been called.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL