Here is an open source tool we developed at Move.

https://github.com/vbodurov/dynamic-proxy-creator

You can also find it in Nuget repository https://nuget.org/packages/com.bodurov.DynamicProxy/1.0.0

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     del.icio.us     E-mail

Please post your comments:

Name:  
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: