Saturday 15 October 2011

Using NCover with Cruise Control.NET and Nant

I had the task of integrating NCover into our continuous builds and integration. At the time I was using Cruise Control.NET v 1.5, NCover v 3.4.18 (classic), and Nant v0.91. I came across several problems when doing this, however I finally came across a solution where by using Nant I was able to build my application, run my Nunit tests and the run my coverage. The route I took involved using the NCover Nant task DLL that comes with NCover and running it over my tests. The issue which held me up the longest was the fact that in order to run coverage over your test DLLs you need to ensure that you include the pdb symbols in your build output, otherwise you'll be going nuts!

Sunday 9 October 2011

IOC - Inversion of Control

Currently, I'm using Inversion of Control (IOC) for most of my application building which I'm finding really useful and quite powerful. Some people consider IOC to be a pattern which follows the three R's: Register, Resolve and Release which is how you would use it by default. IOC usually takes some kind of container which holds all the mappings between objects, for example, if you wanted to use the class Chicken everytime you referenced the interface IAnimal then in you container you may have the following registration: _container.Register.To(); The syntax depends on which IOC library you are using; there are several. My current preferred choice of IOC library is Castle Windsor, which makes using IOC inside applications quite fun and simple.