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
{{ message }}
Repository navigation
Assert.That on a null non-generic IEnumerable throws ArgumentNullException, so IsNull() cannot pass #7698
The overload taking a non-generic IEnumerable also declares its parameter non-nullable, so the compiler warns (CS8604) at the call above. Casting the value to object? makes the assertion pass.
Expected: IsNull() passes for a null non-generic IEnumerable, as it does for IEnumerable<T>. Other assertions on a null value should fail with an assertion failure rather than ArgumentNullException.
Found while migrating an xUnit suite, where Assert.Null(renderings) on a non-generic IEnumerable passed.
Activity
fix: allow null non-generic IEnumerable in Assert.That (thomhurst#7699)