Documentation ¶
Overview ¶
Package test provides Client test helpers.
Index ¶
- func NewMockReceiverClient(t *testing.T, chanSize int, opts ...client.Option) (client.Client, chan<- event.Event)
- func NewMockRequesterClient(t *testing.T, chanSize int, ...) (client.Client, <-chan event.Event)
- func NewMockResponderClient(t *testing.T, chanSize int, opts ...client.Option) (client.Client, chan<- event.Event, <-chan ClientMockResponse)
- func NewMockSenderClient(t *testing.T, chanSize int, opts ...client.Option) (client.Client, <-chan event.Event)
- func SendReceive(t *testing.T, protocolFactory func() interface{}, in event.Event, ...)
- type ClientMockResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockReceiverClient ¶
func NewMockReceiverClient(t *testing.T, chanSize int, opts ...client.Option) (client.Client, chan<- event.Event)
NewMockReceiverClient returns a client that can Receive events, without replying. The returned channel is the channel for sending messages to the client
func NewMockRequesterClient ¶
func NewMockRequesterClient(t *testing.T, chanSize int, replierFn func(inMessage event.Event) (*event.Event, protocol.Result), opts ...client.Option) (client.Client, <-chan event.Event)
NewMockRequesterClient returns a client that can perform Send() event and Request() event. All sent messages are delivered to the returned channel.
func NewMockResponderClient ¶
func NewMockResponderClient(t *testing.T, chanSize int, opts ...client.Option) (client.Client, chan<- event.Event, <-chan ClientMockResponse)
NewMockResponderClient returns a client that can Receive events and reply. The first returned channel is the channel for sending messages to the client, while the second one contains the eventual responses.
Types ¶
Click to show internal directories.
Click to hide internal directories.