本文整理汇总了C#中BaseController.SelectActionResult方法的典型用法代码示例。如果您正苦于以下问题:C# BaseController.SelectActionResult方法的具体用法?C# BaseController.SelectActionResult怎么用?C# BaseController.SelectActionResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseController
的用法示例。
在下文中一共展示了BaseController.SelectActionResult方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSelectActionResult_Xml
public void TestSelectActionResult_Xml(string format)
{
//Arrange
BaseController controller = new BaseController();
var model = new {a = "1", b = 2};
// Act
ActionResult result = controller.SelectActionResult("testName", model, format);
// Assert
Assert.NotNull(result);
Assert.IsInstanceOf<XmlResult>(result);
XmlResult xmlResult = result as XmlResult;
Assert.AreSame(model, xmlResult.Data);
}
示例2: TestSelectActionResult_Html
public void TestSelectActionResult_Html(string format)
{
//Arrange
BaseController controller = new BaseController();
var model = new {a = "1", b = 2};
// Act
string viewName = "testName";
ActionResult result = controller.SelectActionResult(viewName, model, format);
// Assert
Assert.NotNull(result);
Assert.IsInstanceOf<ViewResult>(result);
ViewResult viewResult = result as ViewResult;
Assert.AreSame(model, viewResult.ViewData.Model);
Assert.AreSame(viewName, viewResult.ViewName);
}