views:

32

answers:

1

Hi.

I'm just stuck within ASP.NET, I've created a Unit Test Class for test a blank Web Service (want to do TDD).

When I try to run the Web Service, it supposed to run and fail, but it fail to execute, it says:

The test adapter 'WebHostAdapter' threw an exception while running test 'EnrollmentWSConstructorTest'. The web site could not be configured correctly; getting ASP.NET process information failed. Requesting 'http://localhost:1032/VSEnterpriseHelper.axd' returned an error: The remote server returned an error: (500) Internal Server Error. The remote server returned an error: (500) Internal Server Error.

Any idea?

A: 

You may want to take a look at this link:

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

I found it very helpful when I was on a project that wanted to add after-the-fact unit tests for web services, so spinning up instances of a web server were needed for testing.

Jonathan Bates
Thanks, but this doesn't contain any information related to this specific question.
Randolf R-F
Sorry, reread your question and I gather you are using the built-in tests in Visual Studio instead of NUnit. In that case, have you altered your web.config to allow unauthenticated access to VSEnterpriseHelper.axd?
Jonathan Bates
Well. I try (using the localization snippet) but it doesn't work.Is NUnit simpler than the testing tools that come with VS2010. I came from Java world so have more experience by using JUnit.
Randolf R-F
You might find NUnit more familiar then. It would allow you to test the features of your service as a plain class without having to support the web service feature set. And if you found that you did need to support/test it as a web service, then you can use the original link I provided as guidance.
Jonathan Bates