MSTEST/VSTS 反射工具
有谁知道有一种工具可以输出解决方案中具有 [TestMethod] 属性的所有方法的列表?
我们想要完成的是与客户一起根据要求审查我们的单元测试(名称,而不是通过/失败状态)。 我们正在使用 VSTS 2008 和 Scrum for Team Systems,所以我不确定这是否是内置的东西,或者它是否是我只需要为了我们的目的而组合在一起的工具。 任何帮助都会很棒。 谢谢。
Does anyone know of a tool that will spit out a list of all methods with the [TestMethod] attribute within a solution?
What we're trying to accomplish is a review, with the customer, of our Unit Tests (names, not pass/fail status) against the Requirements. We are using VSTS 2008 and Scrum for Team Systems, so I wasn't sure if this was something that was built in somewhere, or if it's a tool I just need to toss together for our purposes. Any help would be great. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
VS本质上是通过生成TRX文件来总结测试运行的结果来免费提供这种能力的。 有多种不同的方法可以运行项目中的所有测试,但选择一种方法即可,mstest 将使用 [TestMethod] 属性运行每个方法,并在结果文件中生成 UnitTestResult。
您所要求的本质上是测试运行完成后“测试结果”窗口向您显示的内容。 如果您正在寻找 VS 外部的内容,您始终可以针对测试结果 (.trx) 文件运行简单的 XSLT 转换,从而为您提供自定义摘要。 这是一个非常粗略的示例,它证明了这个概念,生成一个 HTML 文档,其中包含一个无序列表,其中每个单元测试都有一个列表项(测试名称和结果):
VS essentially offers this ability for free by generating the TRX file to summarize the results of a test run. There are a number of different ways to run all tests in a project but pick one and off mstest will go running each method with the [TestMethod] attribute and producing a UnitTestResult in the results file.
What you're asking for is essentially what the Test Results window shows you after a completed Test Run. If you're looking for something external to VS, you could always run a simple XSLT transform against the Test Results (.trx) file giving you a customized summary. Here's a very rough sample which proofs the concept, generating an HTML document containing an unordered list with a list item (test name and result) for each unit test: