Today I realised that I’d forgotten how spoilt I am using Resharper and dotCover to run my unit tests. Put another way I’d forgotten how badly Visual Studio plays with any other unit test frameworks other than MS Test! I’m used to and really like the fluent API style of NUnit’s Assert.That(…) syntax so having to fall back to MS Test always feels like a step back. If you ever find yourself in a situation where you can only run MS Tests but want to use NUnit functionality you can easily do this just by using aliases on the NUnit “using” statements.
The following “using” code block facilitates this – you will be able to decorate your unit test classes with MS Test attributes so they can be picked up and run by Visual Studio whilst using NUnit functionality.
using Microsoft.VisualStudio.TestTools.UnitTesting; using Assert = NUnit.Framework.Assert; using Is = NUnit.Framework.Is;
When I first started looking into Windows Workflow one of the first things that I liked about it was how it separated responsibilities. The workflow was responsible for handling the procedural logic with all its conditional statements, etc. Whilst individual code activities could be written to handle the business logic processing; created in small easily re-usable components. To try and realise my original perception this series of blog posts will cover the unit testing of . . .
It seems that a common aim when first starting out in unit testing is to obtain 100% code coverage with our unit tests. This single metric is the defining goal and once obtained a new piece of functionality is targeted. After all, if you have 100% code coverage you can’t get better than that, can you? It’s probably fair to say that it’s taken me several years and a few failed attempts at test-driven development . . .