public void IndexTest() { ActionResultController controller = new ActionResultController(); ActionResult result = controller.Index(); Assert.NotNull(result); }
public void HttpNotFoundResultTest() { var controller = new ActionResultController(); var result = controller.HttpNotFoundResult(); Assert.IsType <HttpNotFoundResult>(result); }
public void Redirect2RouteTest() { var controller = new ActionResultController(); var result = controller.Redirect2Route() as RedirectToRouteResult; Assert.Equal("", result.RouteName); }
public void ScriptResultTest() { var controller = new ActionResultController(); var result = controller.ScriptResult() as JavaScriptResult; Assert.Equal("<script><alert>hi,welcome to .net</alert></script>", result.Script); }
public void Redirect2ActionTest() { var controller = new ActionResultController(); var result = controller.Redirect2Action() as RedirectToRouteResult; Assert.NotNull(result); }
public void EmptyActionTest() { var controller = new ActionResultController(); var result = controller.EmptyAction() as EmptyResult; Assert.NotNull(result); }
public void PageTest() { ActionResultController controller = new ActionResultController(); var result = controller.Page() as ContentResult; Assert.Equal("this is content", result.Content); }
public void BaiduTest() { ActionResultController controller = new ActionResultController(); var result = controller.Baidu() as RedirectResult; Assert.Equal("http://www.baidu.com", result.Url); }
public void JsonResultTest() { var controller = new ActionResultController(); var result = controller.JsonResult() as JsonResult; var data = new JsonObject("ActionResultController", "JsonResult"); Assert.Equal(data.ToString(), result.Data.ToString()); }