I am writing unit tests to test an MVC application. How can I validate my view models from a unit test?
A:
If you are using data annotations for validation you could use reflection to test the presence of validation attributes. If you using FluentValidation then it is a bit more elegant.
Darin Dimitrov
2010-10-30 06:52:50