What:
A “validation” “framework” that, by default convention, does not throw exceptions but instead sets a failed property and builds a list of fail messages.
“Validation”
I took inspiration from the many other server-side validation frameworks.
“Framework”
It’ is just one (fugly) class, < 300 LOC and 70+ tests.
Samples
Take a look at the tests!
http://github.com/detroitpro/Checkers/blob/master/CheckersTests/FluentAPIDesignTests.cs
check.That(2).IsA(typeof(string)).Or("2 is not a string fail");
Features
- That – the item to be checked
- IsNotNull – null check
- IsGreaterThan, IsGreatherThanOrEqualTo, IsLessThan, IsLessThanOrEqualTo
- Is – equality checking for int and string
- IsA – type checking
- Or – Override default fail message
- Fail – No more checks if current check fails
- EpicFail – throw exception
Source
http://github.com/detroitpro/Checkers
Why?
There are so many ways I could answer this question. I’ll just tell you how I thought it would be used.
In a SOA environment where we:
- Don’t want to use exceptions to control business logic flow.
- Don’t want to send exceptions over the wire to our UI/Web servers.
- Don’t want to send exceptions up to our partner API.
- Need to squeeze performance out of our underpowered servers.













You always find the newest toys. Now am I understanding this correctly in saying that this can be used outside of unit testing? Say for checking inputs for a service or action?
Always find? I write the hotness!
Yes, that is exactly what I designed it for. In DOX we finally want to validate request/response w/o throwing exceptions.
Yeah I figured that out (that you wrote it) minutes after I posted the comment. Shouldn’t be a surprise though, I’m not exactly the brightest tool in the bunch.
Looks interesting though.