Fix for #81066 plus test
[mono.git] / mcs / class / System / Test / System.Net / WebClientTest.cs
1 //
2 // WebClientTest.cs - NUnit Test Cases for System.Net.WebClient
3 //
4 // Copyright (C) 2007 Novell, Inc (http://www.novell.com)
5 //
6
7 using NUnit.Framework;
8 using System;
9 using System.IO;
10 using System.Net;
11 using System.Collections;
12 using System.Runtime.Serialization;
13
14 namespace MonoTests.System.Net {
15         [TestFixture]
16         public class WebClientTest {
17
18                 [Test]
19                 [Category ("InetAccess")]
20                 public void DownloadTwice ()
21                 {
22                         WebClient wc = new WebClient();
23                         string filename = Path.GetTempFileName();
24                         
25                         // A new, but empty file has been created. This is a test case
26                         // for bug 81005
27                         wc.DownloadFile("http://google.com/", filename);
28                         
29                         // Now, remove the file and attempt to download again.
30                         File.Delete(filename);
31                         wc.DownloadFile("http://google.com/", filename);
32
33                         // We merely want this to reach this point, bug 81066.
34                 }
35         }
36         
37 }