[System.Net.Http] HttpClient timeout range checks. Fixes #25755
[mono.git] / mcs / class / System.Net.Http / Test / System.Net.Http / HttpClientTest.cs
index 8344c26cc68687b585f7be3a8ef3dd08c2f36328..c87bb7562a16337730f027439914e8bfcfb2b383 100644 (file)
@@ -308,6 +308,18 @@ namespace MonoTests.System.Net.Http
                                Assert.Fail ("#2");
                        } catch (ArgumentOutOfRangeException) {
                        }
+
+                       try {
+                               client.Timeout = TimeSpan.Zero;
+                               Assert.Fail ("#3");
+                       } catch (ArgumentOutOfRangeException) {
+                       }
+
+                       try {
+                               client.Timeout = new TimeSpan(int.MaxValue + 1L);
+                               Assert.Fail ("#3");
+                       } catch (ArgumentOutOfRangeException) {
+                       }
                }
 
                [Test]