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 GetFunctionalRolesForIpo_AsHacker_ShouldReturnBadRequest_WhenUnknownPlant() => await ParticipantsControllerTestsHelper.GetFunctionalRolesForIpoAsync( UserType.Hacker, TestFactory.UnknownPlant, HttpStatusCode.BadRequest, "is not a valid plant");
public async Task GetFunctionalRolesForIpo_AsHacker_ShouldReturnForbidden_WhenPermissionMissing() => await ParticipantsControllerTestsHelper.GetFunctionalRolesForIpoAsync( UserType.Hacker, TestFactory.PlantWithAccess, HttpStatusCode.Forbidden);
public async Task GetFunctionalRolesForIpo_AsAnonymous_ShouldReturnUnauthorized() => await ParticipantsControllerTestsHelper.GetFunctionalRolesForIpoAsync( UserType.Anonymous, TestFactory.UnknownPlant, HttpStatusCode.Unauthorized);