Skip to content

Assertion failures with PropertiesComparer are hard to debug when combined with other modifiers #4909

Description

@Dreamescaper
        await Assert.ThatAsync(() => getExpectedResult()), Is.EqualTo(new ExpectedType
        {
            My = 3.548m,
            Type = 0.312m,
            With = new()
            {
                Lots = true,
                Of = "23456",
                Properties = new(2024, 05, 24)
            }
        }).UsingPropertiesComparer().After(10000, 1000));

Assertion above fails with a not really useful message:

      Assert.That(() => getExpectedResult(), Is.EqualTo(new ExpectedType
        {
            My = 3.548m,
            Type = 0.312m,
            With = new()
            {
                Lots = true,
                Of = "23456",
                Properties = new(2024, 05, 24)
            }
        }).UsingPropertiesComparer().After(10000, 1000))
  Expected: <My.Name.Space.ExpectedType> after 10000 milliseconds delay
  But was:  <My.Name.Space.ExpectedType>

I would be really great to improve it and print the failed property name (like is happens when using PropertiesComparer without After).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions