Esempio n. 1
0
 public async Task GetMcPkgsInProject_AsHacker_ShouldReturnForbidden_WhenPermissionMissing()
 => await ScopeControllerTestsHelper.GetMcPkgsInProjectAsync(
     UserType.Hacker,
     TestFactory.PlantWithAccess,
     TestFactory.ProjectWithAccess,
     "CommPkgNo",
     HttpStatusCode.Forbidden);
Esempio n. 2
0
 public async Task GetMcPkgsInProject_AsAnonymous_ShouldReturnUnauthorized()
 => await ScopeControllerTestsHelper.GetMcPkgsInProjectAsync(
     UserType.Anonymous,
     TestFactory.UnknownPlant,
     TestFactory.ProjectWithAccess,
     "CommPkgNo",
     HttpStatusCode.Unauthorized);
Esempio n. 3
0
 public async Task GetMcPkgsInProject_AsHacker_ShouldReturnBadRequest_WhenUnknownPlant()
 => await ScopeControllerTestsHelper.GetMcPkgsInProjectAsync(
     UserType.Hacker,
     TestFactory.UnknownPlant,
     TestFactory.ProjectWithAccess,
     "CommPkgNo",
     HttpStatusCode.BadRequest,
     "is not a valid plant");
Esempio n. 4
0
        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);
        }