问题
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();
}
}
回答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
来源:https://stackoverflow.com/questions/33410387/nunit-tests-dont-appear-in-tfs-choose-test-dialog-using-visual-studio-2013-c