Exemple #1
0
        public async Task Test_8_1_1_AS4Message_With_Single_Payload_Result_In_Notified_Receipt()
        {
            // Arrange
            AS4Component.Start();
            Holodeck.CopyPModeToHolodeckB("8.1.1-pmode.xml");

            // Act
            AS4Component.PutSubmitMessageSinglePayload("8.1.1-pmode");

            // Assert
            await PollingService.PollUntilPresentAsync(AS4Component.ReceiptsPath);

            Holodeck.AssertSinglePayloadOnHolodeckB();
            AS4Component.AssertReceipt();
        }
Exemple #2
0
        public async Task Test_8_1_15_SubmitMessage_Via_Http_Result_In_Notified_Receipt()
        {
            // Arrange
            AS4Component.OverrideSettings("8.1.15-settings.xml");
            AS4Component.Start();
            const string submitAgentHttpEndpoint = "http://localhost:5001/";

            Holodeck.CopyPModeToHolodeckB("8.1.15-pmode.xml");

            // Act
            await HttpClient.SendMessageAsync(
                submitAgentHttpEndpoint,
                submitmessage_8_1_15_xml,
                "application/xml");

            // Assert
            await PollingService.PollUntilPresentAsync(AS4Component.ReceiptsPath);

            Holodeck.AssertSinglePayloadOnHolodeckB();
            AS4Component.AssertReceipt();
        }
Exemple #3
0
        public async Task Test_8_1_10_AS4Message_With_Single_Payload_And_MessageProperties_Result_In_Delivered_UserMessage_With_Same_MessageProperties()
        {
            // Arrange
            AS4Component.Start();
            Holodeck.CopyPModeToHolodeckB("8.1.10-pmode.xml");

            // Act
            AS4Component.PutSubmitMessage(
                "8.1.10-pmode",
                submit => submit.MessageProperties = new []
            {
                new MessageProperty("Important", "Yes"),
                new MessageProperty("OriginalSender", "AS4.NET")
            },
                AS4Component.SubmitPayloadImage);

            // Assert
            await PollingService.PollUntilPresentAsync(AS4Component.ReceiptsPath);

            Holodeck.AssertSinglePayloadOnHolodeckB();
            AS4Component.AssertReceipt();

            FileInfo userMessageFile =
                new DirectoryInfo(Holodeck.HolodeckBLocations.InputPath)
                .GetFiles("*.xml")
                .FirstOrDefault();

            Assert.True(userMessageFile != null, "No UserMessage found at Holodeck B");

            var userMessageXml = new XmlDocument();

            userMessageXml.Load(userMessageFile.FullName);
            XmlNode messagePropertyNode = userMessageXml.SelectSingleNode("//*[local-name()='MessageProperties']");

            Assert.True(messagePropertyNode != null, "UserMessage at Holodeck B doesn't contain <MessageProperties/> element");
            Assert.True(
                messagePropertyNode.ChildNodes?.Count == 2,
                $"UserMessage at Holodeck B doesn't contain 2 MessageProperties but {messagePropertyNode.ChildNodes?.Count}");
        }