コード例 #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
ファイル: ThemeFileTests.cs プロジェクト: Epitomy/CMS
        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
ファイル: ThemeImageFileTests.cs プロジェクト: Epitomy/CMS
        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);
        }