Beispiel #1
0
        public async Task UnAcceptPunchOut_AsSigner_ShouldUnAcceptPunchOut()
        {
            // Arrange
            var(invitationToUnAcceptId, unAcceptPunchOutDto) = await CreateValidUnAcceptPunchOutDtoAsync(_participantsForSigning);

            // Act
            var newRowVersion = await InvitationsControllerTestsHelper.UnAcceptPunchOutAsync(
                UserType.Signer,
                TestFactory.PlantWithAccess,
                invitationToUnAcceptId,
                unAcceptPunchOutDto);

            // Assert
            var unAcceptedInvitation = await InvitationsControllerTestsHelper.GetInvitationAsync(
                UserType.Viewer,
                TestFactory.PlantWithAccess,
                invitationToUnAcceptId);

            var unAccepterParticipant = unAcceptedInvitation.Participants
                                        .Single(p => p.Organization == Organization.ConstructionCompany);

            var unAcceptingParticipant =
                unAcceptedInvitation.Participants.Single(p => p.Id == unAccepterParticipant.Id);

            Assert.AreEqual(IpoStatus.Completed, unAcceptedInvitation.Status);
            Assert.IsNull(unAcceptingParticipant.SignedAtUtc);
            Assert.IsNull(unAcceptingParticipant.SignedBy);
            AssertRowVersionChange(unAcceptPunchOutDto.InvitationRowVersion, newRowVersion);
        }