public void CanCreateEnvelope() { var message = A.Fake <IMessage>(); var pipelineConfiguration = A.Fake <IHavePipelineConfiguration>(); A.CallTo(() => pipelineConfiguration.LocalEndpointAddress).Returns(new EndpointAddress("sender")); var testee = new OutgoingMessageContext(message, pipelineConfiguration); testee.CreateEnvelope(new EndpointAddress("recipient")); testee.Envelopes.Should().HaveCount(1); testee.Envelopes.Should().Contain(e => IsValidEnvelope(e, message)); }
public override Task InvokeAsync(OutgoingMessageContext context, Func <Task> next) { context.CreateEnvelope(new EndpointAddress("recipient")); this.HasBeenCalled = true; return(Task.CompletedTask); }