Watin is a great tool for testing that your site has the correct elements on it and it does as you expect when someone clicks a button. The problem is you have to have your website actually running and in most cases you don’t when you are running unit tests.

To solve this problem you can use cassini which is the dev server that visual studio uses.

I am going to have a go at using this to run my tests against. These blog posts look like a good place to start:

http://stackoverflow.com/questions/328566/starting-asp-net-development-web-server-cassini-as-part-of-unit-test-setup

http://timescott.wordpress.com/2008/12/09/running-integration-tests-using-cassini/

Normal usage needs cassini.dll adding to the GAC. Use this to add and remove from the GAC:

To add a shared assembly, from the command line enter:

    gacutil.exe /i myassembly.dll

To remove a shared assembly, from the command line enter:

    gacutil.exe /u myassembly.dll

I want to do this without the dependency of cassini being in the GAC so I will try this next:

http://www.hanselman.com/blog/NUnitUnitTestingOfASPNETPagesBaseClassesControlsAndOtherWidgetryUsingCassiniASPNETWebMatrixVisualStudioWebDeveloper.aspx

Posted Thursday, March 12th, 2009 at 6:09 pm
Filed Under Category: .NET
Responses are currently closed, but you can trackback from your own site.

0

Comments are closed.