我有一个Action
如下:
public ActionResult SaveAndExit()
{
ViewModel1 viewModel = new ViewModel1();
return View("Index", viewModel);
}
在单元测试中,我想检查Reg
viewModel 中的视图是否为空。请有任何建议
测试:
//act
var result = controller.SaveAndExit(viewModel) as ViewResult;
//assert
//Assert.IsNotNull(!result.Model["Reg"].Equals(null));