Here is an open source tool we developed at Move.

You can also find it in Nuget repository

The tool takes an existing object and wraps it in interface able to implement this object. For example if you would like to wrap HttpRequest in an interface that you can later pass to your business objects and mock in your tests.

This is how you would use it:

using com.bodurov.DynamicProxy;


IMyRequestWrapper request = To.Proxy<IMyRequestWrapper>(Context.Request);

Share this post:   digg     Stumble Upon     E-mail

Please post your comments:

Email (optional): Your email address will not be posted.
Comments: HTML will be ignored, URLs will be converted to hyperlinks  
Enter the text you see in the box: