Making extension methods amenable to mocking
Posted by: eXtensible mind,
on 19 Feb 2009 |
View original | Bookmarked: 0 time(s)
The question of how to mock extension methods comes up frequently enough that I though I might give my opinion and solution to it (which does NOT include using TypeMock ;)). A first differentiator is whether you control the definition of the extension methods or not. The latter case would be, for example, the built-in Linq extension methods (First, Count, etc. on IEnumerable<T>) and there's no way to mock them unless you use TypeMock. The former would be your own logic that you decide to place...