You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Implemented analyzer suggestions and smaller refactorings (#937)
* refactor: Implemented analyzer suggestions and smaller refactorings
* Use SuppressMessage instead of pragma
* ToList to ToArray
* fix: dont convert to array unnecessarily
* fix of the fix
Co-authored-by: Egil Hansen <egil@assimilated.dk>
[SuppressMessage("Design","CA1019:Define accessors for attribute arguments",Justification="The sole purpose is to have the same public surface as the class in .NET7 and above.")]
Copy file name to clipboardExpand all lines: src/bunit.web/Asserting/DiffAssertExtensions.cs
+22-7Lines changed: 22 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -18,10 +18,18 @@ public static IDiff ShouldHaveSingleChange(this IEnumerable<IDiff> diffs)
18
18
{
19
19
if(diffsisnull)
20
20
thrownewArgumentNullException(nameof(diffs));
21
-
if(diffs.Take(2).Count()!=1)// Optimized way of writing "diffs.Count() != 1"
22
-
thrownewActualExpectedAssertException(diffs.Count().ToString(CultureInfo.InvariantCulture),"1","Actual changes","Expected changes","There were more than one change");
if(diffs.Take(diffInspectors.Length+1).Count()!=diffInspectors.Length)// Optimized way of writing "diffs.Count() != diffInspectors.Length"
42
-
thrownewActualExpectedAssertException(diffs.Count().ToString(CultureInfo.InvariantCulture),diffInspectors.Length.ToString(CultureInfo.InvariantCulture),"Actual changes","Expected changes","The actual number of changes does not match the expected.");
0 commit comments