After updating NUnit from 4.2.2 to 4.3.0, assertions of Is.EqualTo() are failing when the expected argument is not a string.
From what I see, the compiler selects the EqualTo(string? expected) overload.
For example, RedisValue is a struct, but the compiler still selects the string? version.
This causes Assert.That(redisResult, Is.EqualTo(RedisValue.Null) to fail even if redisResult == RedisValue.Null.
I could overcome this only by casting to object?: Assert.That(redisResult, Is.EqualTo((object?)RedisValue.Null)
Also I noticed headers (StringValues) comparisons now fail for assertions that succeeded before.
Using latest .net 9 with latest NUnit.
Thanks.
After updating NUnit from 4.2.2 to 4.3.0, assertions of
Is.EqualTo()are failing when the expected argument is not a string.From what I see, the compiler selects the
EqualTo(string? expected)overload.For example,
RedisValueis a struct, but the compiler still selects the string? version.This causes
Assert.That(redisResult, Is.EqualTo(RedisValue.Null)to fail even if redisResult == RedisValue.Null.I could overcome this only by casting to object?:
Assert.That(redisResult, Is.EqualTo((object?)RedisValue.Null)Also I noticed headers (StringValues) comparisons now fail for assertions that succeeded before.
Using latest .net 9 with latest NUnit.
Thanks.