Ejemplo n.º 1
0
        public async Task UnCompletePunchOut_AsSigner_ShouldUnCompletePunchOut()
        {
            // Arrange
            var(invitationToUnCompleteId, unCompletePunchOutDto) = await CreateValidUnCompletePunchOutDtoAsync(_participantsForSigning);

            // Act
            var newRowVersion = await InvitationsControllerTestsHelper.UnCompletePunchOutAsync(
                UserType.Signer,
                TestFactory.PlantWithAccess,
                invitationToUnCompleteId,
                unCompletePunchOutDto);

            // Assert
            var unCompletedInvitation = await InvitationsControllerTestsHelper.GetInvitationAsync(
                UserType.Signer,
                TestFactory.PlantWithAccess,
                invitationToUnCompleteId);

            var unCompleterParticipant = unCompletedInvitation.Participants
                                         .Single(p => p.Organization == Organization.Contractor);

            var unCompletingParticipant =
                unCompletedInvitation.Participants.Single(p => p.Id == unCompleterParticipant.Id);

            Assert.AreEqual(IpoStatus.Planned, unCompletedInvitation.Status);
            Assert.IsNull(unCompletedInvitation.CompletedBy);
            Assert.IsNull(unCompletedInvitation.CompletedAtUtc);
            Assert.IsNull(unCompletingParticipant.SignedAtUtc);
            Assert.IsNull(unCompletingParticipant.SignedBy);
            AssertRowVersionChange(unCompletePunchOutDto.InvitationRowVersion, newRowVersion);
        }