matt.griffith - thinking out loud

November 26, 2002

Testing .NET Web Applications

I just found Jim Klopfenstein's Executing ASMX files without a web server article. Jim's code could simplify most Web Service unit testing. And since it doesn't need IIS, or even ASP.NET, it would be easy to run during automated builds. Jim doesn't say, but I wouldn't be surprised if this is the reason he was trying to get this working.

I haven't thought much about it but you should be able to do the same thing for ASPX files. Has someone already done this?

Other random thoughts:

  • Combine a port of HttpUnit with an ASPX runner to unit test Web Forms.
  • Use Xml Diff with Jim's ASMX file runner to unit test Web Services.
  • If you host ASP.NET in your own process you should be able to test HttpModules and HttpHandlers.

[ I originally pulled this post when I noticed I had a lot more to learn about the topic. But I'm reposting it since Scott Hanselman posted about it. Needless to say, I haven't thought through any of this nearly as much as I want to. ]