目前,我有nunit的gui测试结构设置,以使用自动命名空间套件。
我想知道是否可以在TestFixture中对方法名进行分组。
此刻,这棵树看起来就像
MyClassTest
+Method-1 test1
+Method-1 test2
+Method-1 test3
+Method-2 test1...我在想能不能让这棵树看起来像
MyClassTest
+Method1
++Method-1 Test1
++Method-1 Test2
++Method-1 Test3
+Method2
++Method-2 Test1我为什么要这么做?这是因为我只想选择" method -1“节点并让它运行该方法的所有测试。我只是省去了检查该方法所有测试的问题。
背景:使用vb.net和vs2010 pro。
编辑:如果我在"Myclass“中创建一个名为"Method1”的类,就会得到以下内容
MyClassTest
+Method-2 test1
MyCalssTest+Method-1
+Test1
+Test2发布于 2011-01-26 12:56:17
为此,我创建了一个Method1测试夹具类,并将Method1Test1、Method1Test2等测试函数作为该类的成员。例如(在C#中)
[TestFixture]
public class Method1
{
[Test]
public void Method1Test1()
{
...
}
[Test]
public void Method1Test2()
{
...
}
} 发布于 2011-01-26 14:39:15
NUnit的类别属性也可能有所帮助。
https://stackoverflow.com/questions/4804621
复制相似问题