a:7:{i:0;s:24:"X-Powered-By: PHP/5.3.28";i:1;s:38:"Expires: Wed, 11 Jan 1984 05:00:00 GMT";i:2;s:51:"Cache-Control: no-cache, must-revalidate, max-age=0";i:3;s:16:"Pragma: no-cache";i:4;s:54:"X-Pingback: http://www.mutation-testing.net/xmlrpc.php";i:5;s:38:"Content-Type: text/html; charset=UTF-8";i:6;s:60:"Link: ; rel=shortlink";} Other testing frameworks - NinjaTurtles

The examples so far have assumed that you use NUnit for your tests. Here, we look at what happens if this isn’t the case.

Using other testing frameworks

NinjaTurtles constructs a list of tests to run, which is framework agnostic, but then it needs to know which test runner to use to actually run the tests. A test runner is a class that implements ITestRunner, and by default, NinjaTurtles will use the NUnitTestRunner, which spawns a process to run nunit-console.exe for each mutant.

Let’s now say, for the sake of argument, that you are actually using xUnit. NinjaTurtles already includes an xUnitTestRunner that will allow you to use xUnit’s own console runner to run xUnit tests. To use this, all you have to do is add a line to your fluent interface calls like this:

[Fact, MutationTest]
public void MethodUnderTest_Mutation_Tests()

Note that the TestAttribute has changed into xUnit’s FactAttribute, but the MutationTestAttribute, which is part of NinjaTurtles, stays.

Runners supported

NinjaTurtles currently supports the following test runners:

  • NUnit (NUnitTestRunner)
  • xUnit (xUnitTestRunner)
  • MSTest (MSTestTestRunner)
  • Gallio (GallioTestRunner)