1

如何以编程方式决定在 NUnit 中运行哪些测试?IE

CoreExtensions.Host.InitializeService();
TestPackage testPackage = new TestPackage(pathToSomeDLL);

// filter by category here??

SimpleTestRunner simpleTestRunner = new SimpleTestRunner();

// or here?
simpleTestRunner.Load(testPackage);

//... maybe here?
testResult = simpleTestRunner.Run(NullListener.NULL);
4

1 回答 1

1

SimpleTestRunner您可以为'sRun方法提供额外的参数,如下所示:

var filter = new CategoryFilter("MyCategory");
simpleTestRunner.Run(NullListener.NULL, filter, false, LoggingThreshold.Off);
于 2013-02-01T00:03:20.627 回答