kbilsted / StatePrinter

Automating unit testing and ToString() coding
Apache License 2.0
92 stars 31 forks source link

Make error message configurable upon assertion failiure #22

Closed kbilsted closed 9 years ago

kbilsted commented 9 years ago

Currently, the assert error message is hard-coded. We need to introduce an abstraction that given the "new" and "old" values used in the assert along with the message provided in the assert and the escaped "new suggested value" for the assert-rewrite

e.g. something

string CreateAssertMessage(
  string actual, 
  string oldExpected, 
  string escapedNewExpected)

and provide a default behaviour that shows the full old and new values for the assert

The CreateAssertMessage should be configurable through the Configuration class.