A practical example on how to mock static classes without TypeMock

WCF is the second biggest framework after ASP.NET that sooner or later forces you to use a static "context" property to do anything beyond the trivial stuff. ASP.NET has the HttpContext.Current, whereas WCF has the WebOperationContext.Current for example.

My friend Pablo Cibraro proves how you can quite easily make your implementations that depend on such static contexts testable without resorting to black-magic voodoo TypeMock kind of stuff. Any .NET developer can trivially introduce an indirection to make their classes testable, even if they depend on static classes. ...

Read full article

Published 19 May 2008 01:03 AM by Daniel Cazzulino
Filed under: , ,

Comments

No Comments

Search

Go

This Blog

News

     

      Microsoft MVP Profile

Syndication