在 Visual Studio 2015 中显示单元测试的描述属性 [英] Displaying the Description attribute of a Unit Test in Visual Studio 2015

查看:28
本文介绍了在 Visual Studio 2015 中显示单元测试的描述属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何在 Visual Studio 2015 中的测试运行期间显示 description 属性?

Does anyone know how to display the description attribute during a test run in Visual Studio 2015?

例如给定这个测试:

        [TestMethod]
        [TestCategory("With Fakes")]
        [Description("Posting a blog entry without the required data should return a BadRequest")]
        public async Task BlogEntryPostTest1()
        {
          ... do test
        }

如何在运行时显示描述?我认为 Test Explorer 不会这样做;有什么办法吗?

How would I get the description to display when running? I don't think Test Explorer will do it; is there any alternative?

推荐答案

不认为这在测试资源管理器(至少 2015 年).我也相信 ReSharpers单元测试"不支持它工具.我认为查看单元测试旁边显示的描述标签的唯一方法是使用 NUnit.

I don't think this is possible in test explorer(at least 2015). I also believe that its not supported in ReSharpers "Unit Testing" tool. I think the only way to see the Description Tag displayed next to the unit test is to use NUnit.

您可以在提议的更改中加入您的声音 此处.也许在下一个版本的测试资源管理器中他们会添加它......现在我会使用 NUnit(加上 GUI) 如果您确实需要查看说明,如果不需要,您可以考虑其他一些 设计方案.

You could add your voice to the the proposed change here. Maybe in the next version of test explorer they will add it... For now I would use NUnit(plus GUI) if you really need to see the description, if not maybe you can consider some of these other design proposals.

这篇关于在 Visual Studio 2015 中显示单元测试的描述属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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