当我尝试单元测试Fr控制器它给我一个错误 [英] When I Try Unit Testing Fr The Controller It Giving Me An Error
问题描述
命名空间Supplier.Test
{
[TestClass] nnamespace Supplier.Test
{
[TestClass ]
公共类SupplierControllerTest
{
[TestMethod]
public void TestIndexView()
{
var w = new SupplierController();
var e =((ViewResult)w.Create())as ViewResult;
Assert.IsNotNull(查看);
}
}
}
amespace Supplier.Test
{
[TestClass]
公共类SupplierControllerTest
{
[TestMethod ]
public void TestIndexView()
{
var w = new SupplierController();
var e = ((ViewResult)w.Create())as ViewResult;
Assert.IsNotNull(View);
}
}
}
错误是
错误2汇编'供应商,版本= 1.0.0.0,Culture =中立,PublicKeyToken = null'使用'System.Web .Mvc,Version = 5.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35',其版本高于引用的程序集'System.Web.Mvc,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'c:\ Users\Okuhle\Desktop\Nonka update\Template.BusinessLogic \Suppliers\bin\Suppliers.dll Supplier.Test
namespace Supplier.Test
{
[TestClass]nnamespace Supplier.Test
{
[TestClass]
public class SupplierControllerTest
{
[TestMethod]
public void TestIndexView()
{
var w = new SupplierController();
var e = ((ViewResult)w.Create()) as ViewResult;
Assert.IsNotNull("View");
}
}
}
amespace Supplier.Test
{
[TestClass]
public class SupplierControllerTest
{
[TestMethod]
public void TestIndexView()
{
var w = new SupplierController();
var e = ((ViewResult)w.Create()) as ViewResult;
Assert.IsNotNull("View");
}
}
}
the error is
Error 2 Assembly 'Suppliers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' c:\Users\Okuhle\Desktop\Nonka update\Template.BusinessLogic\Suppliers\bin\Suppliers.dll Supplier.Test
推荐答案
这篇关于当我尝试单元测试Fr控制器它给我一个错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!