是否可以从ReSharper 7.1.3单元测试中获取Model和Route数据?我似乎必须使用下面的方法在一个或另一个之间做出选择
路线数据
//Execute controller action
var redirect = _controlAgtTran.Create(agency) as RedirectToRouteResult;
//Check route values since Model is not accessible
Assert.IsNotNull(redirect);
Assert.AreEqual("AgentTransmission", redirect.RouteValues["controller"]);
Assert.AreEqual("Index", redirect.RouteValues["action"]);
Assert.AreEqual("Record saved with status of 'Waiting'", redirect.RouteValues["msg"]);
模型信息
//Execute controller action
var result = _controlAgtTran.Create(agency) as ViewResult;
var model = result.Model as AgentTransmission;
//Check model properties since RouteValues is not accesible
Assert.AreEqual(model.RecordStatus, "P");