Archive for the ‘TDD’ Category

Easier Unit Testing of WCF Services with ServiceTestContext

2 Comments »

Hi, and apologies for being so awfully quiet the last couple of months. Expect the traffic to pick up again (I’ll explain the silence in a blog post later).

Now, when unit testing WCF Services, I’ve often ended up with cluttering my tests with a lot of plumbing code to wire up the SUT; that is – the WCF service I want to exercise.

Now, being a lazy guy, wiring up (redundant) plumbing code again and again, I often end up trying to extract the essence and put together a tool or helper class.

So, this is my first shot of a fluent helper class that lets you test your WCF services.

The screenshot below pretty much sums up the functionality. It should be pretty self explaining; You end up writing an Action<TContract> implementation that acts as the client.

It will wire up an OperationContextScope automatically, but it can be disabled if you don’t need it.

ShouldReturnHttp200

The state/quality of the code is “Proof of Concept” and can be found here.


Amazon–; BookShelf++;

2 Comments »

From time to time, I need to “restock” my book shelfs, e.g. order a batch of Computer Science-related books from Amazon.

I placed a new order on Thursday and hopefully I’ll get them all during the week to come.

image xUnit Test Patterns: Refactoring Test Code
Author: Gerard Meszaros
Hardcover, 833 pages
Published: 2007
image Continuous Integration: Improving Software
Quality and Reducing Risk

Authors: Paul M. Duvall et al.
Paperback, 336 pages
Published: 2007
image Refactoring to Patterns
Author: Joshua Kerievsky
Hardcover, 400 pages
Published: 2004
image Semantic Web Primer
Authors: Antoniou et al.
Hardcover, 288 pages
Published: 2008 (Second edition)

So, if the math’s correct, that’ll be 1857 pages of fun to get through this summer :-)