Documentation ¶
Index ¶
- type MockServiceContainer
- func (m *MockServiceContainer) Get(v0 string) (interface{}, error)
- func (m *MockServiceContainer) Inject(v0 interface{}) error
- func (m *MockServiceContainer) MustGet(v0 string) interface{}
- func (m *MockServiceContainer) MustSet(v0 string, v1 interface{})
- func (m *MockServiceContainer) Set(v0 string, v1 interface{}) error
- type ServiceContainerGetFunc
- func (f *ServiceContainerGetFunc) History() []ServiceContainerGetFuncCall
- func (f *ServiceContainerGetFunc) PushHook(hook func(string) (interface{}, error))
- func (f *ServiceContainerGetFunc) PushReturn(r0 interface{}, r1 error)
- func (f *ServiceContainerGetFunc) SetDefaultHook(hook func(string) (interface{}, error))
- func (f *ServiceContainerGetFunc) SetDefaultReturn(r0 interface{}, r1 error)
- type ServiceContainerGetFuncCall
- type ServiceContainerInjectFunc
- func (f *ServiceContainerInjectFunc) History() []ServiceContainerInjectFuncCall
- func (f *ServiceContainerInjectFunc) PushHook(hook func(interface{}) error)
- func (f *ServiceContainerInjectFunc) PushReturn(r0 error)
- func (f *ServiceContainerInjectFunc) SetDefaultHook(hook func(interface{}) error)
- func (f *ServiceContainerInjectFunc) SetDefaultReturn(r0 error)
- type ServiceContainerInjectFuncCall
- type ServiceContainerMustGetFunc
- func (f *ServiceContainerMustGetFunc) History() []ServiceContainerMustGetFuncCall
- func (f *ServiceContainerMustGetFunc) PushHook(hook func(string) interface{})
- func (f *ServiceContainerMustGetFunc) PushReturn(r0 interface{})
- func (f *ServiceContainerMustGetFunc) SetDefaultHook(hook func(string) interface{})
- func (f *ServiceContainerMustGetFunc) SetDefaultReturn(r0 interface{})
- type ServiceContainerMustGetFuncCall
- type ServiceContainerMustSetFunc
- func (f *ServiceContainerMustSetFunc) History() []ServiceContainerMustSetFuncCall
- func (f *ServiceContainerMustSetFunc) PushHook(hook func(string, interface{}))
- func (f *ServiceContainerMustSetFunc) PushReturn()
- func (f *ServiceContainerMustSetFunc) SetDefaultHook(hook func(string, interface{}))
- func (f *ServiceContainerMustSetFunc) SetDefaultReturn()
- type ServiceContainerMustSetFuncCall
- type ServiceContainerSetFunc
- func (f *ServiceContainerSetFunc) History() []ServiceContainerSetFuncCall
- func (f *ServiceContainerSetFunc) PushHook(hook func(string, interface{}) error)
- func (f *ServiceContainerSetFunc) PushReturn(r0 error)
- func (f *ServiceContainerSetFunc) SetDefaultHook(hook func(string, interface{}) error)
- func (f *ServiceContainerSetFunc) SetDefaultReturn(r0 error)
- type ServiceContainerSetFuncCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockServiceContainer ¶
type MockServiceContainer struct { // GetFunc is an instance of a mock function object controlling the // behavior of the method Get. GetFunc *ServiceContainerGetFunc // InjectFunc is an instance of a mock function object controlling the // behavior of the method Inject. InjectFunc *ServiceContainerInjectFunc // MustGetFunc is an instance of a mock function object controlling the // behavior of the method MustGet. MustGetFunc *ServiceContainerMustGetFunc // MustSetFunc is an instance of a mock function object controlling the // behavior of the method MustSet. MustSetFunc *ServiceContainerMustSetFunc // SetFunc is an instance of a mock function object controlling the // behavior of the method Set. SetFunc *ServiceContainerSetFunc }
MockServiceContainer is a mock implementation of the ServiceContainer interface (from the package github.com/go-nacelle/service) used for unit testing.
func NewMockServiceContainer ¶
func NewMockServiceContainer() *MockServiceContainer
NewMockServiceContainer creates a new mock of the ServiceContainer interface. All methods return zero values for all results, unless overwritten.
func NewMockServiceContainerFrom ¶
func NewMockServiceContainerFrom(i service.ServiceContainer) *MockServiceContainer
NewMockServiceContainerFrom creates a new mock of the MockServiceContainer interface. All methods delegate to the given implementation, unless overwritten.
func (*MockServiceContainer) Get ¶
func (m *MockServiceContainer) Get(v0 string) (interface{}, error)
Get delegates to the next hook function in the queue and stores the parameter and result values of this invocation.
func (*MockServiceContainer) Inject ¶
func (m *MockServiceContainer) Inject(v0 interface{}) error
Inject delegates to the next hook function in the queue and stores the parameter and result values of this invocation.
func (*MockServiceContainer) MustGet ¶
func (m *MockServiceContainer) MustGet(v0 string) interface{}
MustGet delegates to the next hook function in the queue and stores the parameter and result values of this invocation.
func (*MockServiceContainer) MustSet ¶
func (m *MockServiceContainer) MustSet(v0 string, v1 interface{})
MustSet delegates to the next hook function in the queue and stores the parameter and result values of this invocation.
func (*MockServiceContainer) Set ¶
func (m *MockServiceContainer) Set(v0 string, v1 interface{}) error
Set delegates to the next hook function in the queue and stores the parameter and result values of this invocation.
type ServiceContainerGetFunc ¶
type ServiceContainerGetFunc struct {
// contains filtered or unexported fields
}
ServiceContainerGetFunc describes the behavior when the Get method of the parent MockServiceContainer instance is invoked.
func (*ServiceContainerGetFunc) History ¶
func (f *ServiceContainerGetFunc) History() []ServiceContainerGetFuncCall
History returns a sequence of ServiceContainerGetFuncCall objects describing the invocations of this function.
func (*ServiceContainerGetFunc) PushHook ¶
func (f *ServiceContainerGetFunc) PushHook(hook func(string) (interface{}, error))
PushHook adds a function to the end of hook queue. Each invocation of the Get method of the parent MockServiceContainer instance invokes the hook at the front of the queue and discards it. After the queue is empty, the default hook function is invoked for any future action.
func (*ServiceContainerGetFunc) PushReturn ¶
func (f *ServiceContainerGetFunc) PushReturn(r0 interface{}, r1 error)
PushReturn calls PushDefaultHook with a function that returns the given values.
func (*ServiceContainerGetFunc) SetDefaultHook ¶
func (f *ServiceContainerGetFunc) SetDefaultHook(hook func(string) (interface{}, error))
SetDefaultHook sets function that is called when the Get method of the parent MockServiceContainer instance is invoked and the hook queue is empty.
func (*ServiceContainerGetFunc) SetDefaultReturn ¶
func (f *ServiceContainerGetFunc) SetDefaultReturn(r0 interface{}, r1 error)
SetDefaultReturn calls SetDefaultDefaultHook with a function that returns the given values.
type ServiceContainerGetFuncCall ¶
type ServiceContainerGetFuncCall struct { // Arg0 is the value of the 1st argument passed to this method // invocation. Arg0 string // Result0 is the value of the 1st result returned from this method // invocation. Result0 interface{} // Result1 is the value of the 2nd result returned from this method // invocation. Result1 error }
ServiceContainerGetFuncCall is an object that describes an invocation of method Get on an instance of MockServiceContainer.
func (ServiceContainerGetFuncCall) Args ¶
func (c ServiceContainerGetFuncCall) Args() []interface{}
Args returns an interface slice containing the arguments of this invocation.
func (ServiceContainerGetFuncCall) Results ¶
func (c ServiceContainerGetFuncCall) Results() []interface{}
Results returns an interface slice containing the results of this invocation.
type ServiceContainerInjectFunc ¶
type ServiceContainerInjectFunc struct {
// contains filtered or unexported fields
}
ServiceContainerInjectFunc describes the behavior when the Inject method of the parent MockServiceContainer instance is invoked.
func (*ServiceContainerInjectFunc) History ¶
func (f *ServiceContainerInjectFunc) History() []ServiceContainerInjectFuncCall
History returns a sequence of ServiceContainerInjectFuncCall objects describing the invocations of this function.
func (*ServiceContainerInjectFunc) PushHook ¶
func (f *ServiceContainerInjectFunc) PushHook(hook func(interface{}) error)
PushHook adds a function to the end of hook queue. Each invocation of the Inject method of the parent MockServiceContainer instance invokes the hook at the front of the queue and discards it. After the queue is empty, the default hook function is invoked for any future action.
func (*ServiceContainerInjectFunc) PushReturn ¶
func (f *ServiceContainerInjectFunc) PushReturn(r0 error)
PushReturn calls PushDefaultHook with a function that returns the given values.
func (*ServiceContainerInjectFunc) SetDefaultHook ¶
func (f *ServiceContainerInjectFunc) SetDefaultHook(hook func(interface{}) error)
SetDefaultHook sets function that is called when the Inject method of the parent MockServiceContainer instance is invoked and the hook queue is empty.
func (*ServiceContainerInjectFunc) SetDefaultReturn ¶
func (f *ServiceContainerInjectFunc) SetDefaultReturn(r0 error)
SetDefaultReturn calls SetDefaultDefaultHook with a function that returns the given values.
type ServiceContainerInjectFuncCall ¶
type ServiceContainerInjectFuncCall struct { // Arg0 is the value of the 1st argument passed to this method // invocation. Arg0 interface{} // Result0 is the value of the 1st result returned from this method // invocation. Result0 error }
ServiceContainerInjectFuncCall is an object that describes an invocation of method Inject on an instance of MockServiceContainer.
func (ServiceContainerInjectFuncCall) Args ¶
func (c ServiceContainerInjectFuncCall) Args() []interface{}
Args returns an interface slice containing the arguments of this invocation.
func (ServiceContainerInjectFuncCall) Results ¶
func (c ServiceContainerInjectFuncCall) Results() []interface{}
Results returns an interface slice containing the results of this invocation.
type ServiceContainerMustGetFunc ¶
type ServiceContainerMustGetFunc struct {
// contains filtered or unexported fields
}
ServiceContainerMustGetFunc describes the behavior when the MustGet method of the parent MockServiceContainer instance is invoked.
func (*ServiceContainerMustGetFunc) History ¶
func (f *ServiceContainerMustGetFunc) History() []ServiceContainerMustGetFuncCall
History returns a sequence of ServiceContainerMustGetFuncCall objects describing the invocations of this function.
func (*ServiceContainerMustGetFunc) PushHook ¶
func (f *ServiceContainerMustGetFunc) PushHook(hook func(string) interface{})
PushHook adds a function to the end of hook queue. Each invocation of the MustGet method of the parent MockServiceContainer instance invokes the hook at the front of the queue and discards it. After the queue is empty, the default hook function is invoked for any future action.
func (*ServiceContainerMustGetFunc) PushReturn ¶
func (f *ServiceContainerMustGetFunc) PushReturn(r0 interface{})
PushReturn calls PushDefaultHook with a function that returns the given values.
func (*ServiceContainerMustGetFunc) SetDefaultHook ¶
func (f *ServiceContainerMustGetFunc) SetDefaultHook(hook func(string) interface{})
SetDefaultHook sets function that is called when the MustGet method of the parent MockServiceContainer instance is invoked and the hook queue is empty.
func (*ServiceContainerMustGetFunc) SetDefaultReturn ¶
func (f *ServiceContainerMustGetFunc) SetDefaultReturn(r0 interface{})
SetDefaultReturn calls SetDefaultDefaultHook with a function that returns the given values.
type ServiceContainerMustGetFuncCall ¶
type ServiceContainerMustGetFuncCall struct { // Arg0 is the value of the 1st argument passed to this method // invocation. Arg0 string // Result0 is the value of the 1st result returned from this method // invocation. Result0 interface{} }
ServiceContainerMustGetFuncCall is an object that describes an invocation of method MustGet on an instance of MockServiceContainer.
func (ServiceContainerMustGetFuncCall) Args ¶
func (c ServiceContainerMustGetFuncCall) Args() []interface{}
Args returns an interface slice containing the arguments of this invocation.
func (ServiceContainerMustGetFuncCall) Results ¶
func (c ServiceContainerMustGetFuncCall) Results() []interface{}
Results returns an interface slice containing the results of this invocation.
type ServiceContainerMustSetFunc ¶
type ServiceContainerMustSetFunc struct {
// contains filtered or unexported fields
}
ServiceContainerMustSetFunc describes the behavior when the MustSet method of the parent MockServiceContainer instance is invoked.
func (*ServiceContainerMustSetFunc) History ¶
func (f *ServiceContainerMustSetFunc) History() []ServiceContainerMustSetFuncCall
History returns a sequence of ServiceContainerMustSetFuncCall objects describing the invocations of this function.
func (*ServiceContainerMustSetFunc) PushHook ¶
func (f *ServiceContainerMustSetFunc) PushHook(hook func(string, interface{}))
PushHook adds a function to the end of hook queue. Each invocation of the MustSet method of the parent MockServiceContainer instance invokes the hook at the front of the queue and discards it. After the queue is empty, the default hook function is invoked for any future action.
func (*ServiceContainerMustSetFunc) PushReturn ¶
func (f *ServiceContainerMustSetFunc) PushReturn()
PushReturn calls PushDefaultHook with a function that returns the given values.
func (*ServiceContainerMustSetFunc) SetDefaultHook ¶
func (f *ServiceContainerMustSetFunc) SetDefaultHook(hook func(string, interface{}))
SetDefaultHook sets function that is called when the MustSet method of the parent MockServiceContainer instance is invoked and the hook queue is empty.
func (*ServiceContainerMustSetFunc) SetDefaultReturn ¶
func (f *ServiceContainerMustSetFunc) SetDefaultReturn()
SetDefaultReturn calls SetDefaultDefaultHook with a function that returns the given values.
type ServiceContainerMustSetFuncCall ¶
type ServiceContainerMustSetFuncCall struct { // Arg0 is the value of the 1st argument passed to this method // invocation. Arg0 string // Arg1 is the value of the 2nd argument passed to this method // invocation. Arg1 interface{} }
ServiceContainerMustSetFuncCall is an object that describes an invocation of method MustSet on an instance of MockServiceContainer.
func (ServiceContainerMustSetFuncCall) Args ¶
func (c ServiceContainerMustSetFuncCall) Args() []interface{}
Args returns an interface slice containing the arguments of this invocation.
func (ServiceContainerMustSetFuncCall) Results ¶
func (c ServiceContainerMustSetFuncCall) Results() []interface{}
Results returns an interface slice containing the results of this invocation.
type ServiceContainerSetFunc ¶
type ServiceContainerSetFunc struct {
// contains filtered or unexported fields
}
ServiceContainerSetFunc describes the behavior when the Set method of the parent MockServiceContainer instance is invoked.
func (*ServiceContainerSetFunc) History ¶
func (f *ServiceContainerSetFunc) History() []ServiceContainerSetFuncCall
History returns a sequence of ServiceContainerSetFuncCall objects describing the invocations of this function.
func (*ServiceContainerSetFunc) PushHook ¶
func (f *ServiceContainerSetFunc) PushHook(hook func(string, interface{}) error)
PushHook adds a function to the end of hook queue. Each invocation of the Set method of the parent MockServiceContainer instance invokes the hook at the front of the queue and discards it. After the queue is empty, the default hook function is invoked for any future action.
func (*ServiceContainerSetFunc) PushReturn ¶
func (f *ServiceContainerSetFunc) PushReturn(r0 error)
PushReturn calls PushDefaultHook with a function that returns the given values.
func (*ServiceContainerSetFunc) SetDefaultHook ¶
func (f *ServiceContainerSetFunc) SetDefaultHook(hook func(string, interface{}) error)
SetDefaultHook sets function that is called when the Set method of the parent MockServiceContainer instance is invoked and the hook queue is empty.
func (*ServiceContainerSetFunc) SetDefaultReturn ¶
func (f *ServiceContainerSetFunc) SetDefaultReturn(r0 error)
SetDefaultReturn calls SetDefaultDefaultHook with a function that returns the given values.
type ServiceContainerSetFuncCall ¶
type ServiceContainerSetFuncCall struct { // Arg0 is the value of the 1st argument passed to this method // invocation. Arg0 string // Arg1 is the value of the 2nd argument passed to this method // invocation. Arg1 interface{} // Result0 is the value of the 1st result returned from this method // invocation. Result0 error }
ServiceContainerSetFuncCall is an object that describes an invocation of method Set on an instance of MockServiceContainer.
func (ServiceContainerSetFuncCall) Args ¶
func (c ServiceContainerSetFuncCall) Args() []interface{}
Args returns an interface slice containing the arguments of this invocation.
func (ServiceContainerSetFuncCall) Results ¶
func (c ServiceContainerSetFuncCall) Results() []interface{}
Results returns an interface slice containing the results of this invocation.