Documentation ¶
Overview ¶
Package testing provides an implementation of bus.Bus and bus.Endpoint suitable for testing.
Index ¶
- func GetCallArgs(tc bus.Endpoint) []callArgs
- func NewMultiValuedTestingBus(dialTC condition.Interface, callTC condition.Interface, ...) bus.Bus
- func NewMultiValuedTestingEndpoint(dialCond condition.Interface, callCond condition.Interface, ...) bus.Endpoint
- func NewTestingBus(dialTC condition.Interface, callTC condition.Interface, retvals ...interface{}) bus.Bus
- func NewTestingEndpoint(dialCond condition.Interface, callCond condition.Interface, ...) bus.Endpoint
- func SetWatchSource(tc bus.Endpoint, member string, watchSource chan []interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCallArgs ¶
GetCallArgs returns a list of the arguments for each Call() invocation.
func NewMultiValuedTestingBus ¶
func NewMultiValuedTestingBus(dialTC condition.Interface, callTC condition.Interface, retvalses ...[]interface{}) bus.Bus
Build a bus.Bus that takes a condition to determine whether it should work, as well as a condition and a series of lists of return values for the testing bus.Endpoint it builds.
func NewMultiValuedTestingEndpoint ¶
func NewMultiValuedTestingEndpoint(dialCond condition.Interface, callCond condition.Interface, retvalses ...[]interface{}) bus.Endpoint
Build a bus.Endpoint that calls OK() on its condition before returning the provided return values.
NOTE: Call() always returns the first return value; Watch() will provide each of them in turn, irrespective of whether Call has been called.
func NewTestingBus ¶
func NewTestingBus(dialTC condition.Interface, callTC condition.Interface, retvals ...interface{}) bus.Bus
Build a bus.Bus that takes a condition to determine whether it should work, as well as a condition and series of return values for the testing bus.Endpoint it builds.
func NewTestingEndpoint ¶
func SetWatchSource ¶
If SetWatchSource is called with a non-nil watchSource, it is used instead of the default timeout and retvals to get values to send over WatchSignal. Set it to nil again to restore default behaviour.
Types ¶
This section is empty.