[System] Fixed HttpWebRequest test that sometimes failed
commit2bacb92d36a9977120108d2e46a0181ea67c581a
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Sat, 5 Jul 2014 18:14:54 +0000 (5 20:14 +0200)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Mon, 7 Jul 2014 21:53:50 +0000 (7 23:53 +0200)
treec22560deb952b90bc18477d842e551c806ce324d
parente6161595777cb984c74e52bb1b7927c5290436cd
[System] Fixed HttpWebRequest test that sometimes failed

The TestTimeoutPropertyWithServerThatDoesntExist test sometimes failed with a 'ConnectFailure' instead of a 'Timeout'.
As per the discussion in PR #1145, the test should actually check that a ConnectFailure is thrown before the timeout is reached.
This proved unreliable with the 10.128.200.100 IP address, as it was up to the networking stack to decide whether the endpoint can be reached,
which can take quite a long time (sometimes >100secs).

Instead, we now use the loopback address with a port where no service listens, which should be equivalent.

Additionally, the assert which checks for the correct exception switched the 'expected' and 'actual' parameter, which resulted in the wrong output, this is fixed as well.
mcs/class/System/Test/System.Net/HttpWebRequestTest.cs