Making WCF services amenable to testing

You know that using WebOperationContext.Current is BAD for making your service implementation testable, don't you?

My friend Pablo Cibraro continued to evolve his ideas around decoupling your service implementation from this static dependency, and came up with the most simple yet totally unobtrusive (for production code) approach to this, which he calls WCFMock.

The idea is quite simple: you can leverage C# class aliasing functionality (which few know it even exists) to conditionally (i.e. DEBUG vs RELEASE builds) replace the WebOperationContext implementation, like so:...

Read full article

Published 10 March 2009 06:29 PM by Daniel Cazzulino
Filed under: ,

Comments

No Comments

Search

Go

This Blog

News

     

      Microsoft MVP Profile

Syndication