I have a client program based on LibCurl. I have run into a situation where on some occasions a program on the server runs longer than the configured IIS timeout. IIS then terminates the program and returns a 502 error status to the client.
I have added code to the client to capture this issue. Now, I need to find a way to prove that the change will work.
I haven’t been able to reliably reproduce the issue, so don’t have a good test case.
Any suggestions?
This shows you, in a very simple way, how to embed a worker process in an NUnit fixture.
You can then serve up as many errors as you like.
Here is a sample fixture:
And here is the server:
One caveat:
NOTE: The Microsoft.VisualStudio.WebHost namespace is contained in the file WebDev.WebHost.dll. This file is in the GAC but it is not possible to add a reference to this assembly from within Visual Studio.
To add a reference you will need to open your .csproj file in a text editor and add the reference manually.
Look for the ItemGroup that contains the project references and add the following element:
Reference: http://www.codeproject.com/KB/aspnet/test-with-vs-devserver-2.aspx