How to use test suite in NUnit 3

江枫思渺然 提交于 2020-02-24 07:50:30

问题


I'm using NUnit 3 and having problems using test suites. I saw this Documentation page, but it's for the old version and I can't find anything in the new documentation.

This does not work, because [Suite] is invalid.

[Suite]
public static IEnumerable Suite
{
  get
  {
    ArrayList suite = new ArrayList();
    suite.Add(typeof(OneTestCase));
    suite.Add(typeof(AssemblyTests));
    suite.Add(typeof(NoNamespaceTestFixture));
    return suite;
  }

回答1:


The SuiteAttribute has been removed from NUnit 3 (see the Attributes table).

You should instead use the expanded Test Selection Language in the command line runner to control the groups of tests you want to run, or alternatively structure your tests differently.



来源:https://stackoverflow.com/questions/38955854/how-to-use-test-suite-in-nunit-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!