From d1b75eac082497dd1246cbc0b7f454bc5b35c005 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 18 Feb 2013 10:31:17 -0100 Subject: [PATCH] Update wrong config path in unit tests --- .../PublishedContent/DynamicNodeTests.cs | 102 +++++++++--------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/src/Umbraco.Tests/PublishedContent/DynamicNodeTests.cs b/src/Umbraco.Tests/PublishedContent/DynamicNodeTests.cs index e693c0d8a8..bd8944a027 100644 --- a/src/Umbraco.Tests/PublishedContent/DynamicNodeTests.cs +++ b/src/Umbraco.Tests/PublishedContent/DynamicNodeTests.cs @@ -12,66 +12,66 @@ using System.Linq; namespace Umbraco.Tests.PublishedContent { - [TestFixture] - public class DynamicNodeTests : DynamicDocumentTestsBase - { - protected override bool RequiresDbSetup - { - get { return true; } - } + [TestFixture] + public class DynamicNodeTests : DynamicDocumentTestsBase + { + protected override bool RequiresDbSetup + { + get { return true; } + } - public override void Initialize() - { - base.Initialize(); - //copy the umbraco settings file over - var currDir = new DirectoryInfo(TestHelper.CurrentAssemblyDirectory); - File.Copy( - currDir.Parent.Parent.Parent.GetDirectories("Umbraco.Web.UI") - .First() - .GetDirectories("config").First() - .GetFiles("umbracoSettings.Release.config").First().FullName, - Path.Combine(currDir.Parent.Parent.FullName, "config", "umbracoSettings.config"), - true); + public override void Initialize() + { + base.Initialize(); + //copy the umbraco settings file over + var currDir = new DirectoryInfo(TestHelper.CurrentAssemblyDirectory); + File.Copy( + currDir.Parent.Parent.Parent.GetDirectories("Umbraco.Web.UI") + .First() + .GetDirectories("config").First() + .GetFiles("umbracoSettings.Release.config").First().FullName, + Path.Combine(currDir.Parent.Parent.FullName, "config", "umbracoSettings.config"), + true); - UmbracoSettings.SettingsFilePath = IOHelper.MapPath(SystemDirectories.Config, false); + UmbracoSettings.SettingsFilePath = Core.IO.IOHelper.MapPath(Core.IO.SystemDirectories.Config + Path.DirectorySeparatorChar, false); - //for testing, we'll specify which assemblies are scanned for the PluginTypeResolver - PluginManager.Current.AssembliesToScan = new[] + //for testing, we'll specify which assemblies are scanned for the PluginTypeResolver + PluginManager.Current.AssembliesToScan = new[] { typeof(DynamicNode).Assembly }; - //need to specify a custom callback for unit tests - DynamicNode.GetDataTypeCallback = (docTypeAlias, propertyAlias) => - { - if (propertyAlias == "content") - { - //return the rte type id - return Guid.Parse("5e9b75ae-face-41c8-b47e-5f4b0fd82f83"); - } - return Guid.Empty; - }; + //need to specify a custom callback for unit tests + DynamicNode.GetDataTypeCallback = (docTypeAlias, propertyAlias) => + { + if (propertyAlias == "content") + { + //return the rte type id + return Guid.Parse("5e9b75ae-face-41c8-b47e-5f4b0fd82f83"); + } + return Guid.Empty; + }; - } + } - public override void TearDown() - { - base.TearDown(); + public override void TearDown() + { + base.TearDown(); - PluginManager.Current.AssembliesToScan = null; - } + PluginManager.Current.AssembliesToScan = null; + } - protected override dynamic GetDynamicNode(int id) - { - //var template = Template.MakeNew("test", new User(0)); - //var ctx = GetUmbracoContext("/test", template.Id); - var ctx = GetUmbracoContext("/test", 1234); - var contentStore = new DefaultPublishedContentStore(); - var node = new DynamicNode( - new DynamicBackingItem( - new Node(ctx.GetXml().SelectSingleNode("//*[@id='" + id + "' and @isDoc]")))); - Assert.IsNotNull(node); - return (dynamic) node; - } - } + protected override dynamic GetDynamicNode(int id) + { + //var template = Template.MakeNew("test", new User(0)); + //var ctx = GetUmbracoContext("/test", template.Id); + var ctx = GetUmbracoContext("/test", 1234); + var contentStore = new DefaultPublishedContentStore(); + var node = new DynamicNode( + new DynamicBackingItem( + new Node(ctx.GetXml().SelectSingleNode("//*[@id='" + id + "' and @isDoc]")))); + Assert.IsNotNull(node); + return (dynamic)node; + } + } } \ No newline at end of file