public async Task when_executed_without_context_it_should_fail() { var container = SetupContainer(); var pipeline = new Pipeline(); var pipeFitter = new VentureEgressPipeFitter(container.GetInstance <IDiContainerAdapter>()); // ReSharper disable once AssignNullToNotNullAttribute - it's a test against null. // ReSharper disable once ObjectCreationAsStatement Func <Task> sut = () => pipeline.Execute(context: null); await using (AsyncScopedLifestyle.BeginScope(container)) { pipeFitter.AppendStepsInto(pipeline); sut.Should().Throw <ArgumentNullException>("context is required"); } }
public void when_append_steps_into_pipeline_it_should_contain_expected_steps_in_expected_order() { var container = SetupContainer(); var pipeline = new Pipeline(); var sut = new VentureEgressPipeFitter(container.GetInstance <IDiContainerAdapter>()); using (AsyncScopedLifestyle.BeginScope(container)) { sut.AppendStepsInto(pipeline); } pipeline.Steps.Select(step => step.GetType()).Should().Equal( new[] { typeof(ValidateMessagePublishingContextStep), typeof(GetMessageKeyStep), typeof(GetTopicNameStep), typeof(GetBrokerMetadataStep), typeof(SerializeMessageStep) }, "it is all steps in proper order"); }