1

Closed

Improved exception message for string comparison

description

When comparing long strings, the exception message only tells me that the string is "too short", but it doesn't say how long it is or should have been or where the difference is.

The assertions in NUnit actually gives a better clue here, for instance;
"Expected string length 370 but was 368. Strings differ at index 1."
Closed Aug 25, 2012 at 2:19 PM by
All done with the public beta of Fluent Assertions 2.0

comments

wrote Aug 12, 2012 at 7:19 AM

Associated with changeset 80959: When strings differ in length, it will report the expected and actual lengths as part of the failure messages.
Fixes some unit tests because of the extended messages when using structural equality comparisons.