testing

package
v0.0.0-...-2fed64a Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: GPL-3.0, GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package testing provides an implementation of bus.Bus and bus.Endpoint suitable for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCallArgs

func GetCallArgs(tc bus.Endpoint) []callArgs

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 NewTestingEndpoint(dialCond condition.Interface, callCond condition.Interface, retvals ...interface{}) bus.Endpoint

func SetWatchSource

func SetWatchSource(tc bus.Endpoint, member string, watchSource chan []interface{})

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.

Jump to

Keyboard shortcuts

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