Fixed unit tests

This commit is contained in:
Shannon Deminick
2013-02-27 22:35:27 +06:00
parent ba530061a0
commit 36c66e676a
2 changed files with 15 additions and 4 deletions

View File

@@ -38,6 +38,14 @@ namespace Umbraco.Core.Configuration
#endregion
/// <summary>
/// used for unit tests
/// </summary>
internal static void ResetCache()
{
_reservedUrlsCache = null;
}
/// <summary>
/// Gets the reserved urls from web.config.
/// </summary>
@@ -69,7 +77,8 @@ namespace Umbraco.Core.Configuration
var staticReservedPaths = "~/app_plugins/,~/install/,";
//always add the umbraco path to the list
if (ConfigurationManager.AppSettings.ContainsKey("umbracoPath"))
if (ConfigurationManager.AppSettings.ContainsKey("umbracoPath")
&& !ConfigurationManager.AppSettings["umbracoPath"].IsNullOrWhiteSpace())
{
staticReservedPaths += ConfigurationManager.AppSettings["umbracoPath"].EnsureEndsWith(',');
}

View File

@@ -23,10 +23,12 @@ namespace Umbraco.Tests
public override void TearDown()
{
//reset the app config
ConfigurationManager.AppSettings.Set("umbracoReservedPaths", "");
ConfigurationManager.AppSettings.Set("umbracoReservedUrls", "");
Umbraco.Core.Configuration.GlobalSettings.ResetCache();
base.TearDown();
//reset the app config
ConfigurationManager.AppSettings.Set("umbracoReservedPaths", "");
ConfigurationManager.AppSettings.Set("umbracoReservedUrls", "");
}
[TestCase("/umbraco/umbraco.aspx")]