开发者

Passing Delegate into MbUnit RowTest?

开发者 https://www.devze.com 2023-02-11 06:21 出处:网络
I\'ve got an MbUnit unit test that I want to use Row tests for, and as one of the parameters, I want to pass a delegate.So something like this:

I've got an MbUnit unit test that I want to use Row tests for, and as one of the parameters, I want to pass a delegate. So something like this:

public delegate object MyDelegate();
[Test]
[Row(SpecificDelegate)]
public void MyTest(MyDelegate specificDelegate)
{
    // DO TEST
}
public object SpecificDelegate()
{
    return null;
}

However, this doesn't seem to work - I get t开发者_运维技巧he following error:

Argument 1: cannot convert from 'method group' to 'object[]'

Is there any way of doing this?


I'd use a [Factory] instead, see the docs about it for more information.

0

精彩评论

暂无评论...
验证码 换一张
取 消