예제 #1
0
        protected async Task <StepResult> ExerciseCreateAS4Message(MessagingContext context)
        {
            var stubRetriever = new Mock <IPayloadRetriever>();

            stubRetriever.Setup(r => r.RetrievePayloadAsync(It.IsAny <string>()))
            .ReturnsAsync(Stream.Null);

            var sut = new CreateAS4MessageStep(_ => stubRetriever.Object);

            // Act
            return(await sut.ExecuteAsync(context));
        }
예제 #2
0
        private static async Task <AS4Message> AssembleAS4MessageAsync(SendingProcessingMode pmode, IEnumerable <PayloadInfo> payloads)
        {
            var submitMessage = new SubmitMessage
            {
                PMode    = pmode,
                Payloads = payloads.Select(p => new Payload(p.PayloadName, "", p.ContentType)).ToArray()
            };

            var createAS4MessageStep = new CreateAS4MessageStep(
                submitPayload => new InMemoryPayloadRetriever(
                    payloads.First(p => p.PayloadName == submitPayload.Id)));

            var ctx = new MessagingContext(submitMessage)
            {
                SendingPMode = pmode
            };
            StepResult stepResult = await createAS4MessageStep.ExecuteAsync(ctx);

            return(stepResult.MessagingContext.AS4Message);
        }
예제 #3
0
        private static async Task <StepResult> ExerciseCreation(MessagingContext context)
        {
            var sut = new CreateAS4MessageStep();

            return(await sut.ExecuteAsync(context));
        }