Test 'InvokeWebService' exceeded execution timeout period
How do I increase开发者_开发技巧 the default execution timeout for my unit tests? I have a unit test which calls a web service. It often runs for longer than 10 seconds, which produces a timeout error. I'm using Visual Studio Team System 2008.
There are a bunch of different ways to control the timeouts of unit tests in visual Studio. See this article for guidance: How to: Set Time Limits for Running Tests. (The article is written for 2010, but I verified that the settings exist in 2008 as well.)
As an aside, calling a real Web Service from a unit test is generally not recommended. You would be better off using a mocking framework (like Rhino Mocks) and dependency inversion to construct your code in such a way that you can test without requiring a connection to a real service.
精彩评论