Example #1
0
        public async Task ChangeAttendedStatusOnParticipants_AsSigner_ShouldChangeAttendedStatus()
        {
            //Arrange
            var(invitationToChangeId, participantToChangeDtos) = await CreateValidParticipantToChangeDtosAsync(_participantsForSigning);

            var updatedNote = participantToChangeDtos[0].Note;

            //Act
            await InvitationsControllerTestsHelper.ChangeAttendedStatusAndNotesOnParticipantsAsync(
                UserType.Signer,
                TestFactory.PlantWithAccess,
                invitationToChangeId,
                participantToChangeDtos);

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

            var completerParticipant = invitationWithUpdatedAttendedStatus.Participants
                                       .Single(p => p.Organization == Organization.Contractor);

            var participant =
                invitationWithUpdatedAttendedStatus.Participants.Single(p => p.Id == completerParticipant.Id);

            Assert.AreEqual(updatedNote, participant.Note);
            Assert.AreEqual(false, participant.Attended);
        }