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); }
public async Task GetProjectsInPlant_AsHacker_ShouldReturnForbidden_WhenPermissionMissing() => await ScopeControllerTestsHelper.GetProjectsInPlantAsync( UserType.Hacker, TestFactory.PlantWithAccess, HttpStatusCode.Forbidden);
public async Task GetProjectsInPlant_AsHacker_ShouldReturnBadRequest_WhenUnknownPlant() => await ScopeControllerTestsHelper.GetProjectsInPlantAsync( UserType.Hacker, TestFactory.UnknownPlant, HttpStatusCode.BadRequest, "is not a valid plant");
public async Task GetProjectsInPlant_AsAnonymous_ShouldReturnUnauthorized() => await ScopeControllerTestsHelper.GetProjectsInPlantAsync( UserType.Anonymous, TestFactory.UnknownPlant, HttpStatusCode.Unauthorized);