C#: Add a RedundantToStringCall test case.

This commit is contained in:
Michael Nebel
2025-01-09 10:39:05 +01:00
parent 261b8db144
commit f905be4df3
2 changed files with 4 additions and 0 deletions

View File

@@ -9,5 +9,8 @@ class RedundantToString
Console.WriteLine($"Hello: {o.ToString()}"); // BAD
Console.WriteLine($"Hello: {o}"); // GOOD
Console.WriteLine("Hello: " + o.ToString()); // BAD
Console.WriteLine("Hello: " + o); // GOOD
}
}

View File

@@ -1,3 +1,4 @@
| RedundantToStringCall.cs:7:27:7:38 | call to method ToString | Redundant call to 'ToString' on a String object. |
| RedundantToStringCall.cs:10:37:10:48 | call to method ToString | Redundant call to 'ToString' on a String object. |
| RedundantToStringCall.cs:13:39:13:50 | call to method ToString | Redundant call to 'ToString' on a String object. |
| RedundantToStringCallBad.cs:7:45:7:56 | call to method ToString | Redundant call to 'ToString' on a String object. |