Can you mock out .NET extension methods with Typemock? – the answer is yes

In Kevin Jones’ session at today’s DDD South West on ‘Testing ASP.NET MVC Applications’ the question was asked it it was possible to mock out .NET extension methods using any mocking frameworks. Kevin said did not think it could be done with Rhino Mocks, but thought it might be possible with Typemock.

Given my experience with Typemock I could see no reason why you would not be able to fake an extension method with Typemock, though I had never had need to do it. A quick search when I got home provided this post by Dennis van der Stelt which explains how to do it. t is just as easy as you would expect.