mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Accounting for themes with base themes with base themes with...
--HG-- branch : dev
This commit is contained in:
@@ -123,6 +123,18 @@ namespace Orchard.Tests.Modules.Themes.Services {
|
||||
Assert.That(siteTheme.ThemeName, Is.EqualTo("ThemeOne"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ThemeWithCircularBaseDepTrowsExceptionOnActivation() {
|
||||
_themeService.SetSiteTheme("ThemeOne");
|
||||
try {
|
||||
_themeService.SetSiteTheme("ThemeFourBasedOnFive");
|
||||
} catch (InvalidOperationException ex) {
|
||||
Assert.That(ex.Message, Is.StringMatching("ThemeFiveBasedOnFour"));
|
||||
}
|
||||
var siteTheme = _themeService.GetSiteTheme();
|
||||
Assert.That(siteTheme.ThemeName, Is.EqualTo("ThemeOne"));
|
||||
}
|
||||
|
||||
#region Stubs
|
||||
|
||||
public class TestSessionLocator : ISessionLocator {
|
||||
@@ -155,6 +167,8 @@ namespace Orchard.Tests.Modules.Themes.Services {
|
||||
new ExtensionDescriptor {Name = "ThemeOne", ExtensionType = "Theme"},
|
||||
new ExtensionDescriptor {Name = "ThemeTwo", BaseTheme = "ThemeOne", ExtensionType = "Theme"},
|
||||
new ExtensionDescriptor {Name = "ThemeThree", BaseTheme = "TheThemeThatIsntThere", ExtensionType = "Theme"},
|
||||
new ExtensionDescriptor {Name = "ThemeFourBasedOnFive", BaseTheme = "ThemeFiveBasedOnFour", ExtensionType = "Theme"},
|
||||
new ExtensionDescriptor {Name = "ThemeFiveBasedOnFour", BaseTheme = "ThemeFourBasedOnFive", ExtensionType = "Theme"},
|
||||
};
|
||||
|
||||
foreach (var extension in extensions) {
|
||||
|
Reference in New Issue
Block a user