/BlogEngine/BlogEngine.Tests/Navigation/CustomPages.cs
C# | 53 lines | 46 code | 7 blank | 0 comment | 0 complexity | 0186ece57ffad21b2cc44d306b4f0a33 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
- using System;
- using NUnit.Framework;
- using BlogEngine.Tests.FileSystem;
-
- namespace BlogEngine.Tests.Navigation
- {
- [TestFixture]
- class CustomPages : BeTest
- {
- private static string TestFile = "";
-
- [SetUp]
- public void Init()
- {
- TestFile = "<%@ Page Language=\"C#\" %>" + Environment.NewLine;
- TestFile += "<script runat=\"server\"></script>" + Environment.NewLine;
- TestFile += "<html xmlns=\"http://www.w3.org/1999/xhtml\">" + Environment.NewLine;
- TestFile += "<head runat=\"server\"><title></title></head><body><form id=\"form1\" runat=\"server\"><div>This is a test ASPX page.</div></form></body></html>";
- }
-
- [Test]
- public void CanNavigateToCustomAspxPage()
- {
- IO.MkFile("test.aspx", TestFile);
- ie.GoTo(Constants.Root + "/test.aspx");
- ie.WaitForComplete();
- Assert.IsTrue(ie.ContainsText("This is a test ASPX page."));
- }
-
- [Test]
- public void CanNavigateToDefaultAspxPageInSubDiretory()
- {
- IO.MkDir("User controls/test");
- IO.MkFile("User controls/test/Default.aspx", TestFile);
-
- ie.GoTo(Constants.Root + "/User controls/test/Default.aspx");
- ie.WaitForComplete();
- Assert.IsTrue(ie.ContainsText("This is a test ASPX page."));
-
- ie.GoTo(Constants.Root + "/User controls/test/");
- ie.WaitForComplete();
- Assert.IsTrue(ie.ContainsText("This is a test ASPX page."));
- }
-
- [TearDown]
- public void Dispose()
- {
- IO.DelFile("test.aspx");
- IO.DelFile("User controls/test/Default.aspx");
- IO.DelDir("User controls/test");
- }
- }
- }