예제 #1
0
파일: ThemeFileTests.cs 프로젝트: Godoy/CMS
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }