C# Assert.IsInstanceOfType无法从对象转换为System.Type
我正在阅读一本关于mvc4收据的书,我正在努力学习下面的例子C# Assert.IsInstanceOfType无法从对象转换为System.Type,c#,.net,nunit,C#,.net,Nunit,我正在阅读一本关于mvc4收据的书,我正在努力学习下面的例子 // act ViewResult result = controller.Index() as ViewResult; // assert Assert.IsInstanceOfType(result.Model,typeof(List<Architect>)) //act ViewResult=controller.Index()作为ViewResult; //断言 Assert.IsInstanceOfType(r
// act
ViewResult result = controller.Index() as ViewResult;
// assert
Assert.IsInstanceOfType(result.Model,typeof(List<Architect>))
//act
ViewResult=controller.Index()作为ViewResult;
//断言
Assert.IsInstanceOfType(result.Model,typeof(列表))
这条线
Assert.IsInstanceOfType(result.Model,typeof(List<Architect>))
Assert.IsInstanceOfType(结果、模型、类型(列表))
抛出两个错误
你需要交换你的论点
Assert.IsInstanceOfType(typeof(List<Architect>),result.Model);
Assert.IsInstanceOfType(typeof(List),result.Model);
匹配的最佳重载方法
Nunit.Framework.Assert.IsInstanceOfType(System.Type,object)有一些
无效参数
它说第一个参数是System.Type
,第二个参数是object