Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The type or namespace name 'TestMethodAttribute' could not be found(are you missing a using directive or an assembly reference?

C#
[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
Posted
Updated 17-Feb-20 23:00pm

1 solution

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:
C#
using Microsoft.VisualStudio.TestTools.UnitTesting;
 
Share this answer
 
Comments
Balu Balaji 31-Dec-13 4:26am    
I solved like this using Microsoft.VisualStudio.TestTools.UnitTesting;
But getting the error like
Error 103 The type 'SWConfigDataSharedLib.Security.IIpPbxUserCredentials' is defined in an assembly that is not referenced. You must add a reference to assembly 'IpPbxCDSSharedLib, Version=0.1.0.11, Culture=neutral, PublicKeyToken=cf78dfa0a74454f8'.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900