public void FailsWithMissingSendingPMode()
            {
                // Arrange
                var receiver        = new PullRequestReceiver(StubConfig.Default);
                var receiverSetting = new Setting("unknown-pmode", string.Empty);

                // Act
                receiver.Configure(new[] { receiverSetting });

                // Assert
                AssertOnMessageReceived(receiver);
            }
            public void FailsWithMissingIntervalAttributes()
            {
                // Arrange
                var receiver = new PullRequestReceiver(StubConfig.Default);
                var invalidReceiverSetting = new Setting("01-send", value: string.Empty);

                // Act
                receiver.Configure(new[] { invalidReceiverSetting });

                // Assert
                AssertOnMessageReceived(receiver);
            }
            public void StartReceiver()
            {
                var stubConfig = new StubConfig(
                    sendingPModes: new Dictionary <string, SendingProcessingMode>
                {
                    ["01-send"] = AS4XmlSerializer.FromString <SendingProcessingMode>(Properties.Resources.send_01)
                },
                    receivingPModes: new Dictionary <string, ReceivingProcessingMode>
                {
                    ["01-receive"] = AS4XmlSerializer.FromString <ReceivingProcessingMode>(Properties.Resources.receive_01)
                });

                // Arrange
                var     receiver        = new PullRequestReceiver(stubConfig);
                Setting receiverSetting = CreateMockReceiverSetting();

                receiver.Configure(new[] { receiverSetting });

                // Act
                receiver.StartReceiving(OnMessageReceived, CancellationToken.None);

                // Assert
                Assert.True(_waitHandle.WaitOne(timeout: TimeSpan.FromMinutes(2)));
            }