2012-06-30 235 views
1

MSTest中相当于MbUnit.Framework.RowAttribute什么是MSTest中MbUnit.Framework.RowAttribute的等价物?

我想给MSTest TestMethod提供不同的数据。在MBUit它是死的简单:

[Row("foo", "bar", "foo bar")] 
[Row("fat", "cat", "fat cat")] 
[Row("wise", "geek", "wise geek")] 
[Test] 
public void TestMyConcat(string first, string second, string expected) 
{ 
    string actual = MyConcat(first, second); 
    Assert.AreEqual(expected, actual); 
} 

这是如何在MSTest的做了什么?

回答

3

AFAIK在MSTest中没有提供直接的等价物。

最接近的是Data Driven Test,它从外部文件中提取数据。

相关问题