record C1
{
public string Name { get; set; }
public int[] Collection { get; set; }
}
var v1 = new C1 { Name = "1", Collection = [1, 2, 3] };
var v2 = new C1 { Name = "1", Collection = [1, 2, 3] };
Assert.That(v1, Is.EqualTo(v2).UsingPropertiesComparer());
The assertion above fails, even thouht the same code works fine if I replace "record" with "class".
I assume that the issue is that record is IEquatable, therefore comparer doesn't attempt to compare it by properties.
I would suggest to ignore IEquatable for records in case UsingPropertiesComparer is used, and still compare it property by property.
The assertion above fails, even thouht the same code works fine if I replace "record" with "class".
I assume that the issue is that record is IEquatable, therefore comparer doesn't attempt to compare it by properties.
I would suggest to ignore IEquatable for records in case
UsingPropertiesCompareris used, and still compare it property by property.