public void IsAuthorizedFor_NullAuthorization_ReturnsTrue() { Authorization.Provider = null; controller = Substitute.ForPartsOf <BaseControllerProxy>(); Assert.Null(controller.AuthorizationProvider); Assert.True(controller.IsAuthorizedFor(null, null, null)); }
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); }