A simple framework for automatic Assert.AreEquals()
, Assert.That()
and ToString()
StatePrinter is a little library that turn any object-graph into a string representation. It is mainly intended automating writing ToString
methods and help automating aspects of writing and maintaining unit tests. Code which is rather dreary and boring to write.
Why you should take StatePrinter for a spin
- No more manual .ToString() - it is much easier to write robus and self-sufficient
ToString()
methods. - No more manual writing/updating Asserts - both for new tests and when the code changes, all tests can automatically be corrected.
- No more screens full of asserts. Especially testing against object-graphs is a bliss.
- Very configurable and extensible.
- It is part of the back-end engine of other projects
- The very nice ApprovalTests framework.
The documentation is split into
and
and
Install Stateprinter from the package manager console:
PM> Install-Package StatePrinter
And for pre-release versions
PM> Install-Package StatePrinter -Pre
For quick questions, Stack Overflow is your best bet. For harder questions. For bugs, issues or feature requests, create a GitHub Issue (and let's chat).
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix the documentation
- Suggest or add new features
StatePrinter has been awarded a ReSharper group lincense, to share among all active contributers.
Version History: http://github.com/kbilsted/StatePrinter/blob/master/CHANGELOG.md
This file describes the latest pushed changes. For documentation of earlier releases see: 1.0.6, 1.0.5, 1.0.4
Upgrading from v1.xx to v2.0.x should be a matter of configuring the Configuration.LegacyBehaviour
Requires .NET 3.5 or newer.
Stateprinter is under the Apache License 2.0, meaning that you can freely use this in other open source or commercial products. If you use it for commercial products please have the courtesy to leave me an email with a 'thank you'.
Have fun!
Kasper B. Graversen