Skip to content

Assert.AreNotEqual not reporting actual value when test failed #18

@boobystu

Description

@boobystu

When the test "Assert.AreNotEqual 1, 1" is attempted the error message contains the text
Expected: not 1
But was : Empty

This behaviour is also seen if tests Assert.AreNotEqualFloats or Assert.AreNotEqualStrings are used.

I've traced this back to EqualConstraint.Matches.
mActual is only populated when mComparer.Equals(mExpected, Actual) = False.

The fix is to always call "VariantCopyInd mActual, Actual" at the start of EqualConstraint.Matches.

Has anyone noticed this and if so do you have a different solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions