我成功地运行了所有测试:
nunit-console bin\Debug\SeleniumAutomated.dll
但是,当我运行时:
nunit-console /runlist:textFile.txt bin\Debug\SeleniumAutomated.dll
这导致运行 0 个测试。所以,我想知道文本文件本身是否需要任何特定的结构。我努力了:
TestA,
TestB,
TestC
还:
TestA
TestB
TestC
还:
FullNameTestA
FullNameTestB
FullNameTestC
到目前为止没有运气。此外,我想从批处理文件中运行它,如果这可能会有所不同。从http://www.nunit.org/index.php?p=consoleCommandLine&r=2.6.4引用“文件'testlist.txt'应该包含每个测试的全名,每行列出一个。”
我的文件名来源在 C# 中:
TestContext c = TestContext.CurrentContext;
// c.Test.Name for the individual test name
// c.Test.FullName for the fullName
此外,文本文件中没有任何不合适的地方。测试名/全名与我期望的一样(这里可能是错误的)。