Put this in your web.config:
<customerrors defaultredirect="Error.aspx" mode="Off" />
Error 500 is too generic to diagnose.
Once you do that, it will give you the precise locatoion that is causing your site to misbehave, and from that point, you can probably identify the problem and fix it.
From the looks of it though, it seems that wResp might be null, or the returned value from wResp.GetResponseStream might be null. Putting a try/catch block around the code would be a good idea...
try these links will be helpful to you:-
http://stackoverflow.com/questions/260432/500-error-running-visual-studio-asp-net-unit-test[
^]
http://forums.asp.net/t/1411782.aspx/1[
^]