public void IsValidForRequestThrowsIfControllerContextIsNull() { // Arrange AcceptAjaxAttribute attr = new AcceptAjaxAttribute(); // Act & assert ExceptionHelper.ExpectArgumentNullException( delegate { attr.IsValidForRequest(null, null); }, "controllerContext"); }
public void IsValidForRequestReturnsTrueIfRequestIsAjaxRequest() { // Arrange AcceptAjaxAttribute attr = new AcceptAjaxAttribute(); ControllerContext controllerContext = GetControllerContext(true /* isAjaxRequest */); // Act bool isValid = attr.IsValidForRequest(controllerContext, null); // Assert Assert.IsTrue(isValid); }