public void TestPhysicalPath() { string themeName = "theme1"; var site = new Site("Site1"); var theme = new Theme(site, themeName); var themeFile = new ThemeFile(theme, "style1.css"); string expected1 = Path.Combine(site.PhysicalPath, "themes", themeName, "style1.css"); Assert.AreEqual(expected1, themeFile.PhysicalPath, true); }
public void TestVirtualPath() { string themeName = "theme1"; var site = new Site("Site1"); var theme = new Theme(site, themeName); var themeFile = new ThemeFile(theme, "style1.css"); string expected1 = Kooboo.Web.Url.UrlUtility.Combine(site.VirtualPath, "themes", themeName, "style1.css"); Assert.AreEqual(expected1, themeFile.VirtualPath, true); }
public void TestParseFromPhysicalPath() { string siteName = "site1"; string themeName = "theme1"; string fileName = "image1"; string extension = ".jpg"; string physicalPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "sites", siteName, "themes", themeName, "Images", fileName + extension); var themeImageFile = new ThemeFile(physicalPath); Assert.AreEqual(fileName, themeImageFile.Name); Assert.AreEqual(extension, themeImageFile.FileExtension); Assert.AreEqual(themeName, themeImageFile.Theme.Name); Assert.IsTrue(themeImageFile.Site.IsDummy); Assert.AreEqual(siteName, themeImageFile.Site.Name); }