Cannot specify full method name within ignored methods
See original GitHub issueDescribe the bug
So imagine I have the following code:
public static void CheckAnswer(int number)
{
if (number == 42)
{
return;
}
CrashWithException("wrong answer");
}
private static void CrashWithException(string text)
{
throw new Exception(text);
}
For dotnet stryker
, Stryker produces two mutations here, as expected:
Now I want to ignore the exception text mutation. I run Stryker like dotnet stryker -im "['CrashWithException']"
.
This also works as expected:
Now I decide to move the CrashWithException
logic to a separate class Crash
with the method WithException
:
public static void CheckAnswer(int number)
{
if (number == 42)
{
return;
}
Crash.WithException("wrong answer");
}
But now if I run it like dotnet stryker -im "['Crash.WithException']"
the mutation is not ignored anymore:
I can ignore just WithException
but I don’t want that - because the name is not generic enough and I’m afraid to miss some important mutations elsewhere in the code. I want to ignore only this particular one in that particular class.
Expected behavior One can specify the full method name within ignored methods setting and this is taken into account.
Desktop (please complete the following information):
- OS: Windows
- Type of project: Core
- Framework Version: NET 5.0
- Stryker Version: 0.22.7
Additional context I attach the repro. IgnoreRepro.zip
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (12 by maintainers)
Right sorry it should have been closed with the merge but because we changed the default branch github won’t auto close. We keep forgetting :p
Awesome! Good luck.
And a tip: if you want to quickly check how a syntaxtree for this looks like use this website sharplab.io