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() }
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)); }