public void StatusError_404_RedirectTo_Error404() { var controller = new ErrorController(); const string status_code = "404"; var result = controller.ErrorStatus(status_code); var redirect_to_action = Assert.IsType <RedirectToActionResult>(result); Assert.Null(redirect_to_action.ControllerName); Assert.Equal(nameof(ErrorController.Index), redirect_to_action.ActionName); }
public void ErrorStatus_404_RedirectTo_Error() { var controller = new ErrorController(); const string error_status_code = "404"; const string expected_action_name = nameof(ErrorController.Error); var result = controller.ErrorStatus(error_status_code); var redirect_to_action = Assert.IsType <RedirectToActionResult>(result); Assert.Equal(expected_action_name, redirect_to_action.ActionName); Assert.Null(redirect_to_action.ControllerName); }