示例#1
0
        public async Task GetProjectsInPlant_AsViewer_ShouldGetProjectsInPlant()
        {
            // Act
            var projects = await ScopeControllerTestsHelper.GetProjectsInPlantAsync(
                UserType.Viewer,
                TestFactory.PlantWithAccess);

            // Assert
            var project1 = projects.First();
            var project2 = projects.Last();

            Assert.AreEqual(2, projects.Count);
            Assert.AreEqual(ProjectName1, project1.Name);
            Assert.AreEqual(ProjectName2, project2.Name);
        }
示例#2
0
 public async Task GetProjectsInPlant_AsHacker_ShouldReturnForbidden_WhenPermissionMissing()
 => await ScopeControllerTestsHelper.GetProjectsInPlantAsync(
     UserType.Hacker,
     TestFactory.PlantWithAccess,
     HttpStatusCode.Forbidden);
示例#3
0
 public async Task GetProjectsInPlant_AsHacker_ShouldReturnBadRequest_WhenUnknownPlant()
 => await ScopeControllerTestsHelper.GetProjectsInPlantAsync(
     UserType.Hacker,
     TestFactory.UnknownPlant,
     HttpStatusCode.BadRequest,
     "is not a valid plant");
示例#4
0
 public async Task GetProjectsInPlant_AsAnonymous_ShouldReturnUnauthorized()
 => await ScopeControllerTestsHelper.GetProjectsInPlantAsync(
     UserType.Anonymous,
     TestFactory.UnknownPlant,
     HttpStatusCode.Unauthorized);