Merge pull request #3106 from lambdageek/dev/monoerror-unhandled
[mono.git] / mcs / class / System / Test / System.Net / ServicePointTest.cs
index cb6a705905abd585cd3b69198b75f8ab2337d507..346f35bdeacd358202f49bad9a130cef91bd0066 100644 (file)
@@ -210,7 +210,7 @@ public class ServicePointTest
        [Test]
        public void DnsRefreshTimeout ()
        {
-               const int dnsRefreshTimeout = 2;
+               const int dnsRefreshTimeout = 2000;
 
                ServicePoint sp;
                IPHostEntry host0, host1, host2;
@@ -219,7 +219,7 @@ public class ServicePointTest
 
                ServicePointManager.DnsRefreshTimeout = dnsRefreshTimeout;
 
-               uri = new Uri ("http://ww.google.com/");
+               uri = new Uri ("http://localhost/");
                sp = ServicePointManager.FindServicePoint (uri);
 
                hostEntryProperty = typeof (ServicePoint).GetProperty ("HostEntry", BindingFlags.NonPublic | BindingFlags.Instance);
@@ -227,12 +227,12 @@ public class ServicePointTest
                host0 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;
                host1 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;
 
-               Assert.AreEqual (host0, host1, "HostEntry should result in the same IPHostEntry object.");
+               Assert.AreSame (host0, host1, "HostEntry should result in the same IPHostEntry object.");
 
-               Thread.Sleep (dnsRefreshTimeout);
+               Thread.Sleep (dnsRefreshTimeout * 2);
                host2 = hostEntryProperty.GetValue (sp, null) as IPHostEntry;
 
-               Assert.AreNotEqual(host0, host2, "HostEntry should result in a new IPHostEntry " +
+               Assert.AreNotSame(host0, host2, "HostEntry should result in a new IPHostEntry " +
                                "object when DnsRefreshTimeout is reached.");
        }