user3641652
user3641652

Reputation: 21

NUnit Integration With Microsoft Test Manager

I can import test cases to Microsoft Test Manager from unit test assembly created in Visual Studio using tcm testcase import command.When I try to import test cases but using NUnit assembly the command fails saying "No Tests found to import".Is there another way by which I can import test cases created in Nunit to Microsoft Test Manager?

Upvotes: 2

Views: 2270

Answers (2)

ne1410s
ne1410s

Reputation: 7102

We were able to pick up our NUnit tests fine using tcm to import to MTM, by adding a TestMethodAttribute to our NUnit test methods.

For example:

namespace NUnit.Tests
{
  using NUnit.Framework;

  [TestFixture]
  public class SuccessTests
  {
    [Microsoft.VisualStudio.TestTools.UnitTesting.TestMethod] //<-- here
    [Test] 
    public void Add()
    { 
      //
    }
  }
}

Using the fully-qualified reference to TestMethod was preferred over a using directive, since several of the class names clash between either implementation so this would introduce an ambiguity.

With the above in place, we were then able to successfully call tcm.exe to import these tests:

tcm testcase /import /collection:CollectionURL /teamproject:project /storage:path

Upvotes: 3

Varun Bajpai
Varun Bajpai

Reputation: 555

No, your tests need to be in the MSTest framework in order to be integrated with the Microsoft Test Manager. If you want to use MTM you need to convert your NUnit Test cases into MSTests. You can refer this URL in order to achieve this.

Upvotes: 2

Related Questions