NUnit2021 fires when different types T1 and T2 are compared, but T1 implements IEquatable<T2>:
using Microsoft.Extensions.Primitives;
using NUnit.Framework;
namespace UnitTests
{
public class Tests
{
[Test]
public void Test1()
{
var stringValues = new StringValues("abc");
Assert.That(stringValues, Is.EqualTo("abc")); // <-- NUnit2021 fires here. Test passes ✅.
}
}
}
NUnit2021 fires when different types
T1
andT2
are compared, butT1
implementsIEquatable<T2>
: