public async Task GetMcPkgsInProject_AsHacker_ShouldReturnForbidden_WhenPermissionMissing() => await ScopeControllerTestsHelper.GetMcPkgsInProjectAsync( UserType.Hacker, TestFactory.PlantWithAccess, TestFactory.ProjectWithAccess, "CommPkgNo", HttpStatusCode.Forbidden);
public async Task GetMcPkgsInProject_AsAnonymous_ShouldReturnUnauthorized() => await ScopeControllerTestsHelper.GetMcPkgsInProjectAsync( UserType.Anonymous, TestFactory.UnknownPlant, TestFactory.ProjectWithAccess, "CommPkgNo", HttpStatusCode.Unauthorized);
public async Task GetMcPkgsInProject_AsHacker_ShouldReturnBadRequest_WhenUnknownPlant() => await ScopeControllerTestsHelper.GetMcPkgsInProjectAsync( UserType.Hacker, TestFactory.UnknownPlant, TestFactory.ProjectWithAccess, "CommPkgNo", HttpStatusCode.BadRequest, "is not a valid plant");
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 GetMcPkgsInProject_AsViewer_ShouldGetMcPkgsInProject() { // Act var mcPkgs = await ScopeControllerTestsHelper.GetMcPkgsInProjectAsync( UserType.Viewer, TestFactory.PlantWithAccess, TestFactory.ProjectWithAccess, "CommPkgNo"); // Assert var mcPkg1 = mcPkgs.First(); var mcPkg2 = mcPkgs.Last(); Assert.AreEqual(2, mcPkgs.Count); Assert.AreEqual(McPkgNo1, mcPkg1.McPkgNo); Assert.AreEqual(McPkgNo2, mcPkg2.McPkgNo); }
public async Task GetCommPkgsInProject_AsViewer_ShouldGetCommPkgsInProjectV2() { // Act var commPkgSearchResult = await ScopeControllerTestsHelper.GetCommPkgsInProjectV2Async( UserType.Viewer, TestFactory.PlantWithAccess, TestFactory.ProjectWithAccess, "CommPkgNo"); // Assert var commPkg1 = commPkgSearchResult.CommPkgs.First(); var commPkg2 = commPkgSearchResult.CommPkgs.Last(); Assert.AreEqual(2, commPkgSearchResult.CommPkgs.Count); Assert.AreEqual(2, commPkgSearchResult.MaxAvailable); Assert.AreEqual(CommPkgNo1, commPkg1.CommPkgNo); Assert.AreEqual(CommPkgNo2, commPkg2.CommPkgNo); Assert.AreEqual(System, commPkg1.System); Assert.AreEqual(System, commPkg2.System); }
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);