public async Task HandleAsync_None_WarningIsNotLogged(IIntegrationMessage message) { var endpoint = TestConsumerEndpoint.GetDefault(); endpoint.MessageValidationMode = MessageValidationMode.None; var envelope = new InboundEnvelope( message, null, null, new TestOffset(), endpoint, "source-endpoint"); IRawInboundEnvelope?result = null; await new ValidatorConsumerBehavior(_inboundLogger).HandleAsync( ConsumerPipelineContextHelper.CreateSubstitute(envelope, _serviceProvider), context => { result = context.Envelope; return(Task.CompletedTask); }); result.Should().NotBeNull(); _loggerSubstitute.DidNotReceive(LogLevel.Warning, null).Should().BeTrue(); }
public async Task HandleAsync_None_WarningIsNotLogged(IIntegrationMessage message) { var endpoint = TestProducerEndpoint.GetDefault(); endpoint.MessageValidationMode = MessageValidationMode.None; var envelope = new OutboundEnvelope(message, null, endpoint); IOutboundEnvelope?result = null; await new ValidatorProducerBehavior(_outboundLogger).HandleAsync( new ProducerPipelineContext( envelope, Substitute.For <IProducer>(), Substitute.For <IServiceProvider>()), context => { result = context.Envelope; return(Task.CompletedTask); }); result.Should().NotBeNull(); result !.Message.Should().NotBeNull(); _loggerSubstitute.DidNotReceive(LogLevel.Warning, null).Should().BeTrue(); }