Reputation: 20907
can anyone help?
I have a solution in vs 2010 which contains a WCF Service application and a class library which has a number of Nunit test.
The nunit tests the service. Problem is that there is no Asp.net Development server running - is it possible to force it to run under debug mode..
I can press F5 but then i can't run my tests.
Maybe i am doing this all wrong, should i host them under IIS 7 ? rather than the built in development server.
That way the server is ALWAYS available rather then loading on demand
Upvotes: 0
Views: 903
Reputation: 31071
I have a solution with exactly the same layout. I would much rather test them in IIS since that is where they will be deployed, and it's nice to know that the code definitely runs under the restricted IIS account rather than my domain account. I run the unit tests as follows:
aspnet_wp.exe
on my dev machine).Upvotes: 0
Reputation: 37104
See http://www.codeproject.com/KB/aspnet/test-with-vs-devserver-2.aspx for a very lightweight and, in my biased opinion, elegant way to integrate webdev/cassini into your testing environment.
NOTE: the first example of controlling the .exe is for edutainment purposes only. Read through to the second, very brief, code sample for the money shot.
Update:
I use the technique listed above with nunit and most every unit test runner around, including continuous integration on servers that I do not control, extensively with great results.
When I need to simulate a real server with a host name and non-loopback ip address, which WebDev.WebServer and WebDev.WebHost cannot do,
it is so simple and bullet proof it should be illegal. ;-)
CassiniDev is also a perfect replacement for the WebDev.WebServer.exe for VS 2008/2010. It has integrated traffic monitoring and is quick a bit faster, both at startup and at processing.
Upvotes: 1
Reputation: 18495
I haven't tried this but since you haven't gotten any other responses:
http://xneuron.wordpress.com/2009/03/27/launch-cassini-using-command-line/
This looks like a command you could add as a pre-build step to your NUnit tests. Hopefully Resharper honors those commands and ensures they're run before doing its own test-specific builds.
Upvotes: 0