使用NUnit类别属性在dll中运行某些测试?

时间:2013-01-31 20:04:05

标签: testing filter tdd nunit categories

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

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);

1 个答案:

答案 0 :(得分:0)

您可以为SimpleTestRunner的{​​{1}}方法提供其他参数,如下所示:

Run