Geeks With Blogs
// ThomasWeller C#/.NET software development, software integrity, life as a freelancer, and all the rest Readability
A way of doing real-world test-driven development (and some thoughts about it)

This post started out to be a reply to another blog post about some detail of the red/green/refactor cycle in TDD. It ended up as a fairly extensive description of my own personal practice of doing TDD in C#, featuring quite some VS add-ins and discussing some (real-world) aspects of test-driven development along the way...

Posted On Saturday, April 17, 2010 6:38 AM

Unit testing StyleCop rules

Quite a lot of articles and blog posts can be found on the web, that tell you how to write custom rules for MS StyleCop - but almost nothing exists, that deals with the issue of testing such rules. To do something about that, this post presents an easy-to-use Gallio/MbUnit test fixture that makes unit testing of StyleCop rules a breeze...

Posted On Saturday, November 28, 2009 9:00 AM

Validating business objects with AOP (1: the domain)

Validation is one of the most important objectives when crafting a domain. Domain objects must be sheltered from invalid property and method argument values. Moreover, it is sometimes necessary to explicitly validate an object's state, for example to enforce business rules. This is the first post of a three-part series that discusses the use of the ValidationAspects aspect library in different application layers to do this...

Posted On Sunday, November 15, 2009 1:57 PM

AOP can save you tons of repetitive code

Lately I played around a bit with Aspect Oriented Programming, especially with PostSharp and the ValidationAspects library that sits on top of it. I wanted to see how I could reduce the amount of infrastructural code like e.g. value-checking, which is highly repetitive and error-prone. I must say, I was impressed of what can be achieved...

Posted On Tuesday, September 15, 2009 6:41 AM

Keeping your enums in sync with database strings

In some scenarios, you may have a database that contains text data in a column which is restricted to a certain set of discrete values. In such a case it is a good idea to use an enumeration for representing these data in your domain. This post demonstrates an easy and effective way to put this mapping under test.

Posted On Tuesday, August 25, 2009 4:01 AM

Keeping your enums in sync with your database

Having an enum in code that corresponds to a database table is a common scenario in enterprise application development. - For example you may have an 'OrderStatus' enum in your business logic and a corresponding database table 'ORDERSTATUS' in your database. In such a scenario the enum-table relation might be at risk to go out of sync. This post introduces a simple but useful unit test fixture, that keeps an eye on this for the entire project lifetime...

Posted On Saturday, August 22, 2009 7:18 AM

Copyright © Thomas Weller | Powered by: | Join free