I want to write unit tests for a web service. I create my test project, reference my web project (not service reference, assembly reference), then write some code to test the we
Based on the solution above, I've implemented a wrapper class in the O2 Platform that allows the easy use of these mocking classes, for example this is how I can write and read from the HttpRequest.InputStream
var mockHttpContext = new API_Moq_HttpContext();
var httpContext = mockHttpContext.httpContext();
httpContext.request_Write("".line());
httpContext.request_Write(" this is a web page".line());
httpContext.request_Write("");
return httpContext.request_Read();
see this blog post for more details: http://o2platform.wordpress.com/2011/04/05/mocking-httpcontext-httprequest-and-httpresponse-for-unittests-using-moq/