Beispiel #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 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);
        }
Beispiel #4
0
 public async Task GetSignerPersons_AsHacker_ShouldReturnForbidden_WhenPermissionMissing()
 => await ParticipantsControllerTestsHelper.GetSignerPersonsAsync(
     UserType.Hacker,
     TestFactory.PlantWithAccess,
     "p",
     HttpStatusCode.Forbidden);
Beispiel #5
0
 public async Task GetSignerPersons_AsAnonymous_ShouldReturnUnauthorized()
 => await ParticipantsControllerTestsHelper.GetSignerPersonsAsync(
     UserType.Anonymous,
     TestFactory.UnknownPlant,
     "p",
     HttpStatusCode.Unauthorized);