NUnit tests don't appear in TFS choose test dialog using Visual Studio 2013 (C#)

限于喜欢 提交于 2019-12-24 12:38:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!