示例#1
0
        public void IsAuthorizedFor_NullAuthorization_ReturnsTrue()
        {
            Authorization.Provider = null;
            controller             = Substitute.ForPartsOf <BaseControllerProxy>();

            Assert.Null(controller.AuthorizationProvider);
            Assert.True(controller.IsAuthorizedFor(null, null, null));
        }
示例#2
0
        public void RedirectIfAuthorized_Action_NotAuthorized_RedirectsToDefault()
        {
            controller.IsAuthorizedFor("Action", controllerName, areaName).Returns(false);

            Object expected = RedirectToDefault(controller);
            Object actual   = controller.RedirectIfAuthorized("Action");

            Assert.Same(expected, actual);
        }