1

In Visual Studio, if you begin debbuging on a webservice, the ASP.net Development Server will start up for you.

I have a series of unit tests that rely on this server being here. How can I find out how this Development Server is invoked? I would like to start it up automatically.

Charles
  • 50,943
  • 13
  • 104
  • 142
DanDan
  • 10,462
  • 8
  • 53
  • 69
  • 1
    You may take a look at the [following article](http://msdn.microsoft.com/en-us/library/ms243399%28v=vs.90%29.aspx). This being said, a unit test shouldn't be relying on any servers. Those are web and integration tests. A unit test should only test your individual methods in isolation. – Darin Dimitrov Feb 11 '12 at 13:11
  • How should one test a service that is in development? I want to ensure that the correct mandatory data are sent, and expected results are returned. I'd also like to test forced error conditions. – DanDan Feb 11 '12 at 13:29
  • I hope you have layered your application, haven't you? You have a service layer that is weakly coupled to the data access layer. So in your unit test you could simply mock the data access layer and test your service layer in isolation by instantiating the proper class. On the other hand if you have put all your code in a single method and mixed responsibilities you will indeed have hard time unit testing and reusing it in isolation. – Darin Dimitrov Feb 11 '12 at 13:30
  • 1
    Oh it is layered. I was actually creating a fake test service because I don't want to connect to the real thing yet. Also it would be nice to flip between the live and test server. But yes it would probably be easier just to mock it, thanks! – DanDan Feb 11 '12 at 13:36

0 Answers0