nunit-console不运行使用TestCase属性参数化的测试
尝试运行使用TestCase属性参数化的Nunit测试。 像这样的东西:
[TestFixture] public class MyClass { [Test] [TestCase("option1")] [TestCase("option2")] public void Test1(string id) { } }
当我尝试使用nunit控制台运行此测试时
nunit-console.exe MyProject.dll /run:MyNamespace.MyClass.Test1
它工作正常。 但在尝试运行参数化时:
nunit-console.exe MyProject.dll /run:MyNamespace.MyClass.Test1(“option1“)
它只是显示:
测试运行:0,错误:0,失败:0,不确定:0,时间:0.0269838秒未运行:0,无效:0,忽略:0,跳过:0
从我记忆中,它需要被引用一点点不同;
nunit-console.exe MyProject.dll /run:"MyNamespace.MyClass.Test1(\"option1\")"