public async Task HandleAsync_InheritedBinaryFileMessage_RawContentProduced() { var message = new InheritedBinaryFileMessage { Content = new MemoryStream(new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05 }) }; var envelope = new OutboundEnvelope(message, null, TestProducerEndpoint.GetDefault()); IOutboundEnvelope?result = null; await new BinaryFileHandlerProducerBehavior().HandleAsync( new ProducerPipelineContext( envelope, Substitute.For <IProducer>(), Substitute.For <IServiceProvider>()), context => { result = context.Envelope; return(Task.CompletedTask); }); result.Should().NotBeNull(); result !.RawMessage.Should().BeEquivalentTo(message.Content); }