public void TestAnalyseUrl_有参数的情况() { UiPage page = new UiPage(); page.AnalyseUrl("http://localhost:808/TaobaoShopHelper/TestPages/TestStyles.aspx?a=a1", "~/TestPages/"); Assert.AreEqual("http://localhost:808/TaobaoShopHelper/TestPages/TestStyles.aspx?a=a1", page.OrginUrl); Assert.AreEqual("~/TestPages/", page.OrginAppRelativeDirectory); Assert.AreEqual("localhost:808", page.DomainName); Assert.AreEqual("TaobaoShopHelper", page.VirtualName); Assert.AreEqual("/TestPages/", page.RelativeDirectory); Assert.AreEqual("TestStyles.aspx", page.FileName); Assert.AreEqual(true, page.IsHasParamters); Assert.AreEqual("a=a1", page.ParameterString); }
public void TestAnalyseUrl_网站根目录的情况() { UiPage page = new UiPage(); page.AnalyseUrl("http://localhost:808/TestStyles.aspx?a=a1", "~/"); Assert.AreEqual("http://localhost:808/TestStyles.aspx?a=a1", page.OrginUrl); Assert.AreEqual("~/", page.OrginAppRelativeDirectory); Assert.AreEqual("localhost:808", page.DomainName); Assert.IsTrue(string.IsNullOrEmpty(page.VirtualName)); Assert.AreEqual("/", page.RelativeDirectory); Assert.AreEqual("TestStyles.aspx", page.FileName); Assert.AreEqual("a=a1", page.ParameterString); }