A tiny unit testing thing for your peace of mind
PetaTest is tiny but powerful, embeddable, dependency free Unit Testing framework for .NET and Mono.
Another unit testing framework? Really? Yes, read why here.
Features at a Glance
- Tiny - a single C# file you can easily add to any project
- Dependency Free - no other assemblies (other than what's in the GAC) or test runners required - it's all self contained
- Fast - practically no overhead over the time of the tests themselves
- Parameterized Tests - drive test inputs with attributes, or generate them in code
- Active Tests - using attributes, mark any test as active and all others will be ignored - great during development and debugging when you just want to run one test
- Assertions - most of the usual suspects, easily extensible
- Stack Trace - as you'd expect
- Source Code Extracts - see the exact line of code that threw the exception in the report
- Setup and TearDown - for test cases and test fixtures
- Text Output - writes directly to console output (see screenshot), or
- HTML Output - can generate a nice self-contained single file HTML report (see example)
And... it's partially, sort-of, source-code compatible with NUnit - so long as you stick to the assertion model. PetaTest doesn't support NUnit's constraints model - mainly because of the amount of code that would require but also because I find that approach more tedious to write.