-
Notifications
You must be signed in to change notification settings - Fork 733
Closed
Labels
Description
Description
Comparing the same Interface with BeEquivalentTo() fails if the interface contains default interface methods.
Reproduction Steps
public void BeEquivalentTo_Default_Interface_Method()
{
List<ITest> lista = [new Test { Name = "Test" }];
List<ITest> listb = [new Test { Name = "Test" }];
lista.Should().BeEquivalentTo(listb); // Fails with: Expectation has property lista[0].NameLength that the other object does not have.
}
public class Test : ITest
{
public string Name { get; set; }
}
public interface ITest
{
public string Name { get; }
public int NameLength => Name.Length;
}Expected behavior
Doesn't thorw an exception.
Actual behavior
Fails with: Expectation has property lista[0].NameLength that the other object does not have.
Regression?
This worked in 6.12.0 and before but fails in 6.12.1.
Known Workarounds
No response
Configuration
Fluent Assertion 6.12.1
.net 8.0.401
Other information
No response
Are you willing to help with a pull-request?
No