[Mono-list] Jakarta Struts for .net/mono
Miguel de Icaza
miguel at ximian.com
Fri Dec 15 13:56:57 EST 2006
Hello,
> Unfortunately ASP.NET provides sealed HttpContext, HttpRequest, HttpResponse
> which cannot be used to write mocks for testing (I love javax.servlet).
> I considering to wrap this objects to complete Java Servlet API and use
> this interfaces
> for whole port implementation (except httphandler which will instantiate
> wrapped objects)
> and make port completely independent from System.Web.
> At this time I wrap HttpContext, HttpRequest, HttpResponse into custom
> classes which so close to original.
> If it sounds wild, it's possible to use asp.net HttpContext, etc..,
> but unfortunately it's a farewell to unit testing.
Not really, there is an alternative.
Context, Request and Response are just wrappers on top of the low-level
interface SimplerWorkerRequest.
Look at how we write some of the tests in System.Web, where we basically
fake this and we have complete control of what goes over.
More information about the Mono-list
mailing list