1

We are using Visual Studio 2013 and TFS for a new project started more than a month ago. I've chosen NUnit a test framework mainly because I was use to it using Resharper and Teamcity. During the build we have configured TFS to run the tests (using NUnitTestAdapter) and everything is OK. We have now discovered that you can link a unit test to a test case item in TFS and it seems a pretty good thing but in the choose test dialog of a test case item I am able to see only MsTest tests (with TestClass and TestMethod attributes) not NUnit tests.

One option we have is to convert to MSTest (any advise? test set is still small less than 200 tests and it will be mainly replacing the class and method attributes)

For example of the following 2 tests I can only see the first one

[TestClass]
public class TestATestWithMSTest
{

    [TestMethod]
    public void TryItTest()
    {
        true.ShouldBeTrue();
    }

}

[TestFixture]
public class TestATestWithNUnitTest
{

    [Test]
    public void TryItTest()
    {
        true.ShouldBeTrue();
    }

}
Paolo Vigori
  • 1,612
  • 1
  • 18
  • 32
  • 1
    To tell the truth, I cant find a reason any more to prefer NUnit over MsTest. I remember NUnit was ways better 5 years ago but as we use Shouldly for assertion, no attribute for the class, the only thing I have to do is replace [Test] with [TestMethod] and I can get rid of the 2 Nunit dependencies – Paolo Vigori Oct 29 '15 at 09:40

1 Answers1

1

It is only allowed to associate MSTest tests to test case work item in TFS. Associating NUnit test to TFS test case work item is not supported.

There is already one feature request about it on the Microsoft UserVoice site, you can vote it here: https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/2956423-allow-all-unit-test-types-to-be-associated-to-a-wo

Vicky - MSFT
  • 4,970
  • 1
  • 14
  • 22
  • I think I reach that conclusion too. I've also discover I cant migrate to MsTest so easily but I think that test plan is not even meant to be for unit tests. As said on TFS documentation, it should be for integration tests. We have our own framework for that and so I've just added the TestMethod attribute to each integration test method. We'll see how it goes.. – Paolo Vigori Oct 29 '15 at 15:31