有没有办法在 resharper 的测试运行程序中显示部分类名?

发布于 2024-12-28 15:22:13 字数 766 浏览 2 评论 0原文

我创建了一组测试,并使用部分类将它们组合在一起。有没有办法让部分名称显示在测试运行程序中?我所拥有的类似于

文件 1:

 public partial class MyWrapperClass
 {
     [TestClass]
     public class This_is_a_descriptive_scenario { 
          [TestMethod]
          public void This_is_a_descriptive_scenario_outcome() { ... }
     }
 } 

文件 2:

 public partial class MyWrapperClass
 {
     [TestClass]
     public class This_is_a_descriptive_scenario2 { 
          [TestMethod]
          public void This_is_a_descriptive_scenario2_outcome() { ... }
     }
 } 

当在 Visual studio 的内置测试运行器中运行此类测试时,如果我已将类列添加到测试结果中,我可以看到结果为:MyWrapperClass+This_is_a_descriptive_test。但是,当您在 resharper 的 testrunne 中运行测试时,它们会按项目和/或命名空间以及类名进行分组,但我看不到这些测试是任何地方的部分类的一部分。这可能吗?

I have created a set of tests that I have grouped together by using a partial class. Is there a way to get the partial name to show up in the test runner? What I have is something like

File 1:

 public partial class MyWrapperClass
 {
     [TestClass]
     public class This_is_a_descriptive_scenario { 
          [TestMethod]
          public void This_is_a_descriptive_scenario_outcome() { ... }
     }
 } 

File 2:

 public partial class MyWrapperClass
 {
     [TestClass]
     public class This_is_a_descriptive_scenario2 { 
          [TestMethod]
          public void This_is_a_descriptive_scenario2_outcome() { ... }
     }
 } 

When running tests like that in the builtin test runner in Visual studio I can see the result as: MyWrapperClass+This_is_a_descriptive_test, if I have added the class column to the test result. But when you run the test in resharper's testrunne they are grouped by project and/or namespace and the class name, but I can't see that the tests are part of a partial class anywhere. Is that possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

物价感观 2025-01-04 15:22:13

我认为这不被支持。尽管可能可以延长它。如果你愿意沿着这条路走下去,我可以为你指明正确的方向。

最简单的解决方案是使用命名空间进行分组而不是部分类。

希望这对

米格尔有帮助

I don't think this is supported. Although it might be possible to extend it. I can point you in the right direction if you're willing to go down that path.

The easiest solution would be to use namespaces for grouping instead of partial classes.

Hope this helps

Miguel

故事↓在人 2025-01-04 15:22:13

两个文件中的分部类的名称是相同的...不,当前没有任何内容可以按测试文件名对测试进行分组。

The name of a partial class is the same in either file... No, there's nothing that currently groups tests by test file name.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文