基本上我希望能够插入NUnit中的TestCase或TestFixture的方法来改变行为。从本质上说我想这样做:有没有办法将代理传递给NUnit TestCase或TestFixture?
[TestFixture]
public class MethodTests
{
public delegate void SimpleDelegate();
public static void A()
{
// Do something meaningful
}
public static void B()
{
// Do something meaningful
}
public static void C()
{
// Do something meaningful
}
[TestCase(A,B,C)]
[TestCase(C,A,B)]
[TestCase(C,B,A)]
public void Test(SimpleDelegate action1, SimpleDelegate action2, SimpleDelegate action3)
{
action1();
action2();
action3();
}
}
我回来了的误差[测试用例(A,B,C)]是
- 错误6参数1:不能从 '方法组' 转换为 'object'
- 错误7参数2:无法从 '方法组' 转换为 'object'
- 错误8参数3:无法从 '方法组' 转换为 'object'
你知道是否有什么方法可以让这个或者类似的东西起作用?