当我尝试单元测试Fr控制器它给我一个错误 [英] When I Try Unit Testing Fr The Controller It Giving Me An Error

查看:67
本文介绍了当我尝试单元测试Fr控制器它给我一个错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

命名空间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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆