CacheControlFixture.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Text;
  6. using NUnit.Framework;
  7. namespace CassiniDev.NUnitFixtures.Tests
  8. {
  9. /// <summary>
  10. /// http://cassinidev.codeplex.com/workitem/14359
  11. /// </summary>
  12. [TestFixture]
  13. public class CacheControlFixture : CassiniDevServer
  14. {
  15. [TestFixtureSetUp]
  16. public void TestFixtureSetUp()
  17. {
  18. const string applicationPath = @"..\..\..\..\CassiniDev.TestSite";
  19. StartServer(applicationPath);
  20. }
  21. [TestFixtureTearDown]
  22. public void TestFixtureTearDown()
  23. {
  24. StopServer();
  25. }
  26. /// <summary>
  27. /// I am not sure whether I would consider lack of cache headers in a dev server an 'issue'
  28. /// when I am writing code I certainly don't want to be debugging against a cached file.
  29. /// But that is just my initial impression. Certainly a full modified-since implemenation would be
  30. /// nice but I don't think that the infrastructure for that plumbing is worth implementing.
  31. /// </summary>
  32. [Test]
  33. public void Test()
  34. {
  35. // test is null and void
  36. Server.RequestComplete += new EventHandler<RequestEventArgs>(Server_RequestComplete);
  37. string url = NormalizeUrl("static.txt");
  38. var client = new WebClient();
  39. var content = client.DownloadString(url);
  40. }
  41. void Server_RequestComplete(object sender, RequestEventArgs e)
  42. {
  43. }
  44. }
  45. }