Exemplo n.º 1
0
        public async Task TestSpyStep()
        {
            // Arrange
            var step = new SpyStep();

            // Act
            await step.ExecuteAsync(messagingContext : new MessagingContext(AS4Message.Empty, MessagingContextMode.Send));

            // Assert
            Assert.True(step.IsCalled);
        }
            public async void ThenStepStopExecutionWithMarkedStepResult()
            {
                // Arrange
                MessagingContext expectedMessage     = CreateDummyMessageWithAttachment();
                StepResult       stopExecutionResult = StepResult.Success(expectedMessage).AndStopExecution();

                var spyStep       = new SpyStep();
                var compositeStep = new CompositeStep(CreateMockStepWith(stopExecutionResult).Object, spyStep);

                // Act
                StepResult actualResult = await compositeStep.ExecuteAsync(new EmptyMessagingContext());

                // Assert
                Assert.False(spyStep.IsCalled);
                Assert.Equal(expectedMessage, actualResult.MessagingContext);
            }