如何找到所有的单元测试,可能会直接或间接地调用一个给定的方法? (。净) [英] How do I find all the unit tests that may directly or indirectly call a given method? (.net)
问题描述
我如何找到所有的单元测试,可能会直接或间接地调用一个给定的方法? 当我换一种方法,我想知道运行最好的测试;必须有这样的工具!
How do I find all the unit tests that may directly or indirectly call a given method? When I change a method, I wish to know the best tests to run; there must be a tool for this!
由于我们有很多的接口,我对所有的单元测试调用接口的方法时,至少有一个路径var放在一个实现接口的类的植入方法。
As we have lots of interfaces, I am interested in all unit tests that calls a method on an interface when there is at least one path var the implantation method on a class that implements the interface.
或者换句话说,我要当工具不能证明结果不受我已经改变了方法,所有单元测试的列表。
(我们在.NET中使用NUnit的,并有大量的慢单元测试,这将是多年,直到我们重构我们所有的单元测试要快)
(We are using nUnit on .net and have lots of slow unit tests, it will be many year until we have refactored all our unit tests to be fast)
另见:
- <一个href="http://stackoverflow.com/questions/2427047/how-to-find-junit-tests-that-are-using-a-given-java-method-directly-or-indirectly">How发现直接或间接 使用给定的Java方法JUnit测试
- How to find Junit tests that are using a given Java method directly or indirectly
推荐答案
Visual Studio 2010中有这个确切的功能:<一href="http://blogs.msdn.com/b/phuene/archive/2009/12/07/test-impact-analysis-in-visual-studio-2010.aspx" rel="nofollow">http://blogs.msdn.com/b/phuene/archive/2009/12/07/test-impact-analysis-in-visual-studio-2010.aspx
Visual Studio 2010 has this exact feature: http://blogs.msdn.com/b/phuene/archive/2009/12/07/test-impact-analysis-in-visual-studio-2010.aspx
由于您使用NUnit的,你可以试试这个方法运行MSTest的还有:的 http://msdn.microsoft.com/en-gb/magazine/cc163643.aspx#S4
Since you're using nunit, you could try this technique to run MSTest as well: http://msdn.microsoft.com/en-gb/magazine/cc163643.aspx#S4
这篇关于如何找到所有的单元测试,可能会直接或间接地调用一个给定的方法? (。净)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!