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";} Next steps - NinjaTurtles

Here, we consider a couple of slightly more complex mutation test scenarios.

Private classes

If you have a private class whose methods you want to test, then the generic MutationTestBuilder doesn’t help you. In this case, you need to use the non-generic version like so:

[Test, MutationTest]
public void MethodUnderTest_Mutation_Tests()
{
    MutationTestBuilder
        .For("MyAssembly.ClassUnderTest", "MethodUnderTest")
        .Run();
}

NinjaTurtles can then find this class using reflection.

Overloaded methods

If you have an overloaded method that you want to test, you’ll need to identify to NinjaTurtles the types of the parameters that the method takes to resolve the overload. So, if your method takes two string parameters, you’d write a mutation test for it like this:

[Test, MutationTest]
public void MethodUnderTest_Mutation_Tests()
{
    MutationTestBuilder<ClassUnderTest>
        .For("MethodUnderTest",
            new[] { typeof(string), typeof(string) })
        .Run();
}

This works with both the generic and the non-generic versions of the MutationTestBuilder class.

Finally, we will take a look at how you use other testing frameworks.