0

我成功地运行了所有测试:

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

此外,文本文件中没有任何不合适的地方。测试名/全名与我期望的一样(这里可能是错误的)。

4

1 回答 1

1

事实证明,nunit-console 对空格很挑剔。每行后面都有一个空格。通过删除空格并使用全名,它按预期工作。因此,对于遇到此困难的任何其他人,请确保没有任何形式的标点符号。仅使用全名 - 每行一个。

FULLNAMEA
FULLNAMEB
FULLNAMEC
...
于 2015-06-04T15:53:30.777 回答