【问题标题】:what is the equivalant to MbUnit.Framework.RowAttribute in MSTest?MSTest 中 MbUnit.Framework.RowAttribute 的等价物是什么?
【发布时间】:2012-07-02 20:59:17
【问题描述】:

哪个相当于 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 中是如何完成的?

【问题讨论】:

    标签: mstest


    【解决方案1】:

    AFAIK 在 MSTest 中没有提供直接等效项。

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

    【讨论】:

      猜你喜欢
      • 2014-05-08
      • 2014-06-12
      • 1970-01-01
      • 2022-11-28
      • 2021-06-19
      • 2012-07-20
      • 2023-03-30
      • 2011-04-08
      • 2014-09-24
      相关资源
      最近更新 更多