WebClientTest.cs 850 B

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