Ejemplo n.º 1
0
        public void RoleAuthorizedTests(string role)
        {
            //var controller = new HomeController();
            Assert.IsTrue(AuthorizationTest.IsAuthorized(typeof(HomeController), nameof(HomeController.About), null, new[] { role }, null));

            //AuthorizationTest.IsAuthorized(controller, nameof(HomeController.About), null, new[] { "Admin" }, null).Should()
        }
Ejemplo n.º 2
0
 public void AnonymousTests()
 {
     Assert.IsTrue(AuthorizationTest.IsAnonymous(typeof(HomeController), nameof(HomeController.Index), null));
     Assert.IsTrue(AuthorizationTest.IsAnonymous(typeof(HomeController), nameof(HomeController.Contact), null));
     Assert.IsTrue(AuthorizationTest.IsAnonymous(typeof(HomeController), nameof(HomeController.Error), null));
 }