找不到类型或命名空间名称'TestMethodAttribute'(您是否缺少using指令或程序集引用? [英] The type or namespace name 'TestMethodAttribute' could not be found(are you missing a using directive or an assembly reference?

查看:693
本文介绍了找不到类型或命名空间名称'TestMethodAttribute'(您是否缺少using指令或程序集引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

找不到类型或命名空间名称'TestMethodAttribute'(您是否缺少using指令或程序集引用?



 [TestMethod] 
public void Cloud_CreateTenantTest()
{
Assert.IsTrue(newTenant!= null Null Tenant返回);
Assert.IsTrue(newTenant.Name.Equals(newTenant.Name));
Assert.IsTrue(newTenant.TenantID > ; 0 );
}





在visual studio 2010中解决这个问题我们需要使用Microsoft.VisualStudio.TestTools.UnitTesting添加

;

此名称空间但是现在我在这个版本中使用VS2013我怎样才能实现这个

解决方案

< blockquote>我没有尝试在VS2013中这样做,但我很确定它的工作方式与以前的版本相同。





在您的项目中,您需要参考:

Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll



并在您的程序中添加:

 使用 Microsoft.VisualStudio.TestTools.UnitTesting; 


The type or namespace name 'TestMethodAttribute' could not be found(are you missing a using directive or an assembly reference?

[TestMethod]
       public void Cloud_CreateTenantTest()
       {          
           Assert.IsTrue(newTenant != null, "Null Tenant returned");
           Assert.IsTrue(newTenant.Name.Equals(newTenant.Name));
           Assert.IsTrue(newTenant.TenantID > 0);
       }



In visual studio 2010 to solve this problem we need to add
using Microsoft.VisualStudio.TestTools.UnitTesting;
this name space but right now I am using VS2013 in this version how can I achieve this

解决方案

I didn't try to do it in VS2013 but I'm pretty sure it works the same way as in previous versions.


In your project you need to reference:
Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll

And add in your program:

using Microsoft.VisualStudio.TestTools.UnitTesting;


这篇关于找不到类型或命名空间名称'TestMethodAttribute'(您是否缺少using指令或程序集引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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