Search The Blog
About this site

@RoyOsherove

Subscribe!

This site aims to connect all the dots of my online activities - from tools, books blogs and twitter accounts, to upcoming conferences, engagements and user group talks.

from 5whys.com
Twitter: @RoyOsherove
My Book: The Art of Unit Testing
Latest Posts
« Macro - Workaround for VS 2005 unit testing build problem | Main | Video: Implementing Continuous Integration: With and Without Team System »
Sunday
Dec102006

Unit Testing your ASP.NET Validators - Validation Everywhere

heynemann just posted about a very nice and testable validation framework for ASP.NET called "Validation Everywhere".

"The Validation Everywhere project was born because I have a very complex UI that I need to unit test. This UI is built using MVP Architecture (Powered by NMVP), but in ASP.Net it has a lot of Validators logic to perform UI Validation. Since this logic is extremely complex I need to unit test it. ?"

Example can be seen here.

I'd highly recommend taking a look, mainly because if you do a lot of custom validation, or you simply have one validation with lots of logic in it, you would want to make sure it works.  the best way to do that is to write unit tests or it, which is hard to do when you have those things running under ASP.NET.

The V.E framework releases you from that burden by separating concerns - running the validator under its own context, giving you a simple interface you need to implement in your own validator.

Testable code is still not very easy to find. When a framework is written specifically with testability in mind, I'd take a long hard look at that.

PrintView Printer Friendly Version

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>