Visual Studio 2008 单元测试框架中是否有 NUnit 的 TestCaseAttribute 等效项?
你知道,像这样的东西:
[TestCase(1, 1, 1)]
[TestCase(2, 2, 2)]
[TestCase(3, 3, 3)]
public void Test1(int a, int b, int c)
{
// do stuff depending on the TestCase
}
最佳答案
不幸的是,MSTest 不支持这种方式的参数化测试。最接近的是 DataSource属性,允许您为测试方法指定一个外部数据源。
关于c# - NUnit 的 TestCaseAttribute 等效于 VS 单元测试框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2411321/