예제 #1
0
 public async Task GetSignerPersons_AsHacker_ShouldReturnBadRequest_WhenUnknownPlant()
 => await ParticipantsControllerTestsHelper.GetSignerPersonsAsync(
     UserType.Hacker,
     TestFactory.UnknownPlant,
     "p",
     HttpStatusCode.BadRequest,
     "is not a valid plant");
        public async Task GetSignerPersons_AsViewer_NoMatchingPersons_ShouldReturnEmptyList()
        {
            // Act
            var proCoSysPersons = await ParticipantsControllerTestsHelper.GetSignerPersonsAsync(
                UserType.Viewer,
                TestFactory.PlantWithAccess,
                "searchStringWithNoMatchingPersons");

            // Assert
            Assert.AreEqual(0, proCoSysPersons.Count);
        }
        public async Task GetFunctionalRolesForIpo_AsViewer_ShouldGetFunctionalRolesForIpo()
        {
            // Act
            var functionalRoles = await ParticipantsControllerTestsHelper.GetFunctionalRolesForIpoAsync(
                UserType.Viewer,
                TestFactory.PlantWithAccess);

            // Assert
            var functionalRole1 = functionalRoles.First();
            var functionalRole2 = functionalRoles.Last();

            Assert.AreEqual(2, functionalRoles.Count);
            Assert.AreEqual(FunctionalRoleCode1, functionalRole1.Code);
            Assert.AreEqual(FunctionalRoleCode2, functionalRole2.Code);
        }
        public async Task GetSignerPersons_AsViewer_ShouldGetAdditionalSignerPersons()
        {
            // Act
            var signerPersons = await ParticipantsControllerTestsHelper.GetSignerPersonsAsync(
                UserType.Viewer,
                TestFactory.PlantWithAccess,
                "SignersSearchString");

            // Assert
            Assert.AreEqual(1, signerPersons.Count);
            var additionalSignerPerson = signerPersons.First();

            Assert.AreEqual("SigurdUserName", additionalSignerPerson.UserName);
            Assert.AreEqual("Sigurd", additionalSignerPerson.FirstName);
            Assert.AreEqual("Signer", additionalSignerPerson.LastName);
        }
        public async Task GetPersons_AsViewer_ShouldGetPersons()
        {
            // Act
            var proCoSysPersons = await ParticipantsControllerTestsHelper.GetPersonsAsync(
                UserType.Viewer,
                TestFactory.PlantWithAccess,
                "p");

            // Assert
            Assert.AreEqual(2, proCoSysPersons.Count);
            var proCoSysPerson = proCoSysPersons.First();

            Assert.AreEqual("UserName1", proCoSysPerson.UserName);
            Assert.AreEqual("FirstName1", proCoSysPerson.FirstName);
            Assert.AreEqual("LastName1", proCoSysPerson.LastName);
        }
예제 #6
0
 public async Task GetSignerPersons_AsHacker_ShouldReturnForbidden_WhenPermissionMissing()
 => await ParticipantsControllerTestsHelper.GetSignerPersonsAsync(
     UserType.Hacker,
     TestFactory.PlantWithAccess,
     "p",
     HttpStatusCode.Forbidden);
예제 #7
0
 public async Task GetSignerPersons_AsAnonymous_ShouldReturnUnauthorized()
 => await ParticipantsControllerTestsHelper.GetSignerPersonsAsync(
     UserType.Anonymous,
     TestFactory.UnknownPlant,
     "p",
     HttpStatusCode.Unauthorized);
예제 #8
0
 public async Task GetFunctionalRolesForIpo_AsHacker_ShouldReturnForbidden_WhenPermissionMissing()
 => await ParticipantsControllerTestsHelper.GetFunctionalRolesForIpoAsync(
     UserType.Hacker,
     TestFactory.PlantWithAccess,
     HttpStatusCode.Forbidden);
예제 #9
0
 public async Task GetFunctionalRolesForIpo_AsHacker_ShouldReturnBadRequest_WhenUnknownPlant()
 => await ParticipantsControllerTestsHelper.GetFunctionalRolesForIpoAsync(
     UserType.Hacker,
     TestFactory.UnknownPlant,
     HttpStatusCode.BadRequest,
     "is not a valid plant");
예제 #10
0
 public async Task GetFunctionalRolesForIpo_AsAnonymous_ShouldReturnUnauthorized()
 => await ParticipantsControllerTestsHelper.GetFunctionalRolesForIpoAsync(
     UserType.Anonymous,
     TestFactory.UnknownPlant,
     HttpStatusCode.Unauthorized);