【问题标题】:NUnit's TestCaseAttribute equivalent in VS Unit Test FrameworkVS 单元测试框架中 NUnit 的 TestCaseAttribute 等价物
【发布时间】:2010-03-09 18:03:17
【问题描述】:

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 
}

【问题讨论】:

标签: c# visual-studio unit-testing nunit vs-unit-testing-framework


【解决方案1】:

不幸的是,MSTest 不支持这种方式的参数化测试。最接近的是DataSource 属性,它允许您为测试方法指定外部数据源。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-10
    • 2011-01-26
    • 1970-01-01
    相关资源
    最近更新 更多