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