Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I would like to create a test suite using NUnit.

In java, I could use the name of the classes and do something like this:

TestSuite suite = new TestSuite();
suite.addTest(new JUnit4TestAdapter(Class.forName({Name of my test class here})));

In NUnit, I have a TestSuite created (from NUnit.Core) but I can't create Tests dynamically and add them to the suite.

I appreciate the help, thanks.

share|improve this question

1 Answer 1

In NUnit 2.4.4, there is a new feature - the Suite Attribute that allows you to return an array of tests as opposed to using the TestSuite class in previous versions. To add tests, it would look something like this:

[Suite] 
public static IEnumerable Suite
{
   get
   {
      ArrayList suite = new ArrayList();
      suite.Add(new AddAll());
      return suite;
   }
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.