SonarSource/sonar-dotnet

Remove duplicate error message from UTs

Opened this issue · 0 comments

When a UT for a rule fails it always lists the unexpected/lost issues twice. This is redundant information that just increases the cognitive load (unless the content of the second message is different, then it's very relevant).

Message: 
There are differences for CSharp7 UnusedPrivateMember.Concurrent.cs:
  Line 522: Unexpected issue 'Remove unused constructor of private type 'Foo'.' Rule S1144

There are differences for CSharp7 UnusedPrivateMember.cs:
  Line 522: Unexpected issue 'Remove unused constructor of private type 'Foo'.' Rule S1144

Remove the message for the concurrent part if the two contents are the same (save for the Concurrent name).
Note: not all concurrent tests are generated automatically, e.g. MethodsShouldUseBaseTypes.Concurrent.cs

Message: 
There are differences for CSharp7 UnusedPrivateMember.cs:
  Line 522: Unexpected issue 'Remove unused constructor of private type 'Foo'.' Rule S1144