Following on from the previous post describing a validation framework I'm planning to use on MVC projects, this post extends the development to incorporate a range of tests. To recap, I've set up a domain model structure that consists of: Entities - simple classes representing the fields and relationships of my business objects. They consist of properties and methods that act only on those properties (i.e. they have no external dependencies. Repository layer - a number of data access methods that provide CRUD methods for retrieving and data from the database and instantiating the entities, and persisting their changes back. Service layer - a layer consisting of methods that sit between the UI and repository layer, passing method calls and objects in between. These classes combine to provide validation at three levels: Entity validation - these are C# methods defined on the entity object itself to internally validate its fields. They will consist of checks for required fields...
Senior Developer and head of DXP at Umbraco. Previously with Zone, building solutions primarily on .NET and using Umbraco, EPiServer and Sitecore CMS. This blog is used as a repository for various tips, tricks, issues and impressions drawn from the use of technology my work and interests. All words are my own.