Exemple #1
0
        public void GetPageNameWherePageHasNoExtension()
        {
            string pageName = WebUtils.GetPageName("foo");

            Assert.AreEqual(ExpectedPageName, pageName);
            pageName = WebUtils.GetPageName("http://www.madeleine.org/Bingo/Rope/foo");
            Assert.AreEqual(ExpectedPageName, pageName);
        }
Exemple #2
0
        public void GetPageNameSunnyDay()
        {
            string pageName = WebUtils.GetPageName("foo.aspx");

            Assert.AreEqual(ExpectedPageName, pageName);
            pageName = WebUtils.GetPageName("~/foo.aspx");
            Assert.AreEqual(ExpectedPageName, pageName);
            pageName = WebUtils.GetPageName("~/Bingo/foo.aspx");
            Assert.AreEqual(ExpectedPageName, pageName);
            pageName = WebUtils.GetPageName("/Bingo/foo.aspx");
            Assert.AreEqual(ExpectedPageName, pageName);
            pageName = WebUtils.GetPageName("Bingo/foo.aspx");
            Assert.AreEqual(ExpectedPageName, pageName);
            pageName = WebUtils.GetPageName("~/Bingo/Rope/foo.aspx");
            Assert.AreEqual(ExpectedPageName, pageName);
            pageName = WebUtils.GetPageName("/Bingo/Rope/foo.aspx");
            Assert.AreEqual(ExpectedPageName, pageName);
            pageName = WebUtils.GetPageName("Bingo/Rope/foo.aspx");
            Assert.AreEqual(ExpectedPageName, pageName);
            pageName = WebUtils.GetPageName("http://www.madeleine.org/Bingo/Rope/foo.aspx");
            Assert.AreEqual(ExpectedPageName, pageName);
        }
Exemple #3
0
        public void GetPageNameWherePageHasOddExtension()
        {
            string pageName = WebUtils.GetPageName("foo.odd");

            Assert.AreEqual(ExpectedPageName, pageName);
        }
Exemple #4
0
 public void GetPageNameWithWhitespacedUrl()
 {
     WebUtils.GetPageName("   ");
 }
Exemple #5
0
 public void GetPageNameWithEmptyUrl()
 {
     WebUtils.GetPageName(string.Empty);
 }
Exemple #6
0
 public void GetPageNameWithNullUrl()
 {
     WebUtils.GetPageName(null);
 }
 public void GetPageNameWithWhitespacedUrl()
 {
     Assert.Throws <ArgumentNullException>(() => WebUtils.GetPageName("   "));
 }
 public void GetPageNameWithEmptyUrl()
 {
     Assert.Throws <ArgumentNullException>(() => WebUtils.GetPageName(string.Empty));
 }
 public void GetPageNameWithNullUrl()
 {
     Assert.Throws <ArgumentNullException>(() => WebUtils.GetPageName(null));
 }