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