Stryker Mutation test fails when debug statement is added in c# method

121 views Asked by At

Stryker fails to run any test cases under a xunit test class when debug statement is included in the code block.

I have a few test cases covering the below method. Stryker fails to run those tests and also other tests available for other methods in the same class. I tried using "Stryker disable all" and "Stryker restore all" and it doesn't work.

When debug is removed from the below code block all the test cases are executed and stryker just works fine.

I tried running the tests cases in both debug and release mode. Stryker's behaviour is same.

Stryker command:

dotnet stryker -o 
private async Task<X509Certificate2> getcert(string certname, string password)
{
    #if DEBUG
        return new X509Certificate2(certname,
            password);
    #endif
      
    return await _someprovider.getcert(certname,password);
} 
0

There are 0 answers