0

単体テストでオブジェクトを渡すにはどうすればよいですか? ここに私のコードがあります:

    [Test]          
    [Row( "test",5,new CustomField())]      
    public void Test_Constructor(string type, int number, CustomField customField)
    {
       .....
    }

エラーが返されます: 属性引数は、定数式、typeof 式、または属性パラメーター型の配列作成式である必要があります

4

1 に答える 1

2

ファクトリを使用できます。

http://gallio.org/wiki/doku.php?id=mbunit:da​​ta-driven_testing:factory

于 2012-07-04T16:43:07.910 に答える