Skip to content

Idea: Alternative output formatting for Assert.AreEqual(string, string) #978

@simmotech

Description

@simmotech

(background: migrating a project to use MSTest.TestFramework rather than NUnit)

Output from MSTest.TestFramework:

Assert.AreEqual failed. Expected:<A A and A A>. Actual:<A, A and A, A>. 

Output from NUnit:

  Expected string length 11 but was 13. Strings differ at index 1.
  Expected: "A A and A A"
  But was:  "A, A and A, A"
  ------------^

I prefer the latter message to make it clear where the differences are - some can be quite subtle.

I was wondering whether it would be possible to add a StringAssert.AreEqual() implementation that formats its message the NUnit way. Best of both worlds then - callers choice by using StringAssert. or Assert.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions