NUnit测试未出现在TFS中,使用Visual Studio 2013(C#)选择测试对话框 [英] NUnit tests don't appear in TFS choose test dialog using Visual Studio 2013 (C#)

查看:179
本文介绍了NUnit测试未出现在TFS中,使用Visual Studio 2013(C#)选择测试对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将Visual Studio 2013和TFS用于一个多月前开始的新项目.我之所以选择NUnit一个测试框架,主要是因为我使用Resharper和Teamcity来使用它. 在构建过程中,我们已配置TFS来运行测试(使用NUnitTestAdapter),一切正常. 现在,我们发现您可以将单元测试链接到TFS中的测试用例项目,这看起来不错,但是在测试用例项目的选择测试"对话框中,我只能看到MsTest测试(具有TestClass和TestMethod属性) ),而不是NUnit测试.

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.

我们要选择的一种方法是转换为MSTest(任何建议?测试集仍然少于200个测试,它将主要替换类和方法属性)

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)

例如以下2个测试的示例,我只能看到第一个

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();
    }

}

推荐答案

仅允许将MSTest测试与TFS中的测试用例工作项相关联.不支持将NUnit测试与TFS测试用例工作项相关联.

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.

Microsoft UserVoice网站上已经有关于此功能的请求,您可以在此处进行投票:

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

这篇关于NUnit测试未出现在TFS中,使用Visual Studio 2013(C#)选择测试对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆