TestBasicMessageChannelExtension<T> extension

Shim to support the obsolete setMockMessageHandler and checkMockMessageHandler methods on BasicMessageChannel in tests.

The implementations defer to TestDefaultBinaryMessengerBinding.defaultBinaryMessenger.

Rather than calling setMockMessageHandler on the message channel, use tester.binding.defaultBinaryMessenger.setMockDecodedMessageHandler directly. This more accurately represents the actual method invocation.

on

Methods

checkMockMessageHandler(Object? handler) bool

Available on BasicMessageChannel<T>, provided by the TestBasicMessageChannelExtension extension

Shim for TestDefaultBinaryMessenger.checkMockMessageHandler.
setMockMessageHandler(Future<T> handler(T? message)?) → void

Available on BasicMessageChannel<T>, provided by the TestBasicMessageChannelExtension extension

Shim for TestDefaultBinaryMessenger.setMockDecodedMessageHandler.