コード例 #1
0
        public async Task DeleteInvitation_AsPlanner_ShouldDeleteInvitation()
        {
            // Arrange
            var(invitationToDeleteId, rowVersion) = await CreateValidDeletePunchOutDtoAsync(_participantsForSigning);

            await InvitationsControllerTestsHelper.GetHistoryAsync(
                UserType.Creator,
                TestFactory.PlantWithAccess,
                invitationToDeleteId);

            // Act
            await InvitationsControllerTestsHelper.DeletePunchOutAsync(UserType.Planner, TestFactory.PlantWithAccess,
                                                                       invitationToDeleteId, rowVersion);

            // Assert
            await InvitationsControllerTestsHelper.GetInvitationAsync(
                UserType.Creator,
                TestFactory.PlantWithAccess,
                invitationToDeleteId,
                HttpStatusCode.NotFound);

            await InvitationsControllerTestsHelper.GetHistoryAsync(
                UserType.Creator,
                TestFactory.PlantWithAccess,
                invitationToDeleteId,
                HttpStatusCode.NotFound);
        }
コード例 #2
0
        public async Task GetHistory_AsViewer_ShouldGetHistory()
        {
            // Act
            var historyDtos = await InvitationsControllerTestsHelper.GetHistoryAsync(
                UserType.Viewer,
                TestFactory.PlantWithAccess,
                InitialMdpInvitationId);

            // Assert
            Assert.IsNotNull(historyDtos);
            Assert.IsTrue(historyDtos.Count > 0);

            var historyEvent = historyDtos.First();

            Assert.IsNotNull(historyEvent.Description);
            Assert.IsNotNull(historyEvent.EventType);
        }