Exemplo n.º 1
0
        public async Task Updates_ToBeNotified_When_Specified_SendingPMode_And_Reference_InMessage()
        {
            // Arrange
            string ebmsMessageId = Guid.NewGuid().ToString();

            GetDataStoreContext.InsertOutMessage(new OutMessage(ebmsMessageId));

            AS4Message receivedAS4Message =
                AS4Message.Create(new Receipt($"receipt-{Guid.NewGuid()}", ebmsMessageId));

            // Act
            await ExerciseUpdateReceivedMessage(
                receivedAS4Message,
                CreateNotifyAllSendingPMode(),
                receivePMode : null);

            // Assert
            GetDataStoreContext.AssertInMessageWithRefToMessageId(
                ebmsMessageId,
                m =>
            {
                Assert.NotNull(m);
                Assert.Equal(Operation.ToBeNotified, m.Operation);
            });

            GetDataStoreContext.AssertOutMessage(
                ebmsMessageId,
                m =>
            {
                Assert.NotNull(m);
                Assert.Equal(OutStatus.Ack, m.Status.ToEnum <OutStatus>());
            });
        }