Use extension methods with care

.Net 3.5 introduced the extension methods; they can be a nice way to extend classes we have no control over. They can wrap common usages of objects; even implement methods on interfaces to assist the common responsibility of the usage of that interface.

However, extension methods are basically just static methods. They cannot be mocked; also functionality in an extension method has to be white box tested. Remote calls or construction of objects in an extension method requires extra mocking of the objects that use the extension method, which might not be apparent when first writing the tests.