Skip to content

Commit 60bef95

Browse files
committed
fix: added null check
1 parent 292b433 commit 60bef95

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/bunit.web/Asserting/DiffAssertExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ public static void ShouldHaveChanges(this IEnumerable<IDiff> diffs, params Actio
3838
{
3939
if (diffs is null)
4040
throw new ArgumentNullException(nameof(diffs));
41+
if (diffInspectors is null)
42+
throw new ArgumentNullException(nameof(diffInspectors));
43+
4144
if (diffs.Take(diffInspectors.Length + 1).Count() != diffInspectors.Length) // Optimized way of writing "diffs.Count() != diffInspectors.Length"
4245
throw new ActualExpectedAssertException(diffs.Count().ToString(CultureInfo.InvariantCulture), diffInspectors.Length.ToString(CultureInfo.InvariantCulture), "Actual changes", "Expected changes", "The actual number of changes does not match the expected.");
4346

0 commit comments

Comments
 (0)