starts fixing up tests

This commit is contained in:
Shannon
2015-01-23 20:09:42 +11:00
parent 887ccaae83
commit 3e410e6a41
5 changed files with 16 additions and 8 deletions

View File

@@ -56,12 +56,6 @@
<!-- if true umbraco will ensure that no page under the same parent has an identical name -->
<ensureUniqueNaming>True</ensureUniqueNaming>
<!-- clean editor content with use of tidy -->
<TidyEditorContent>False</TidyEditorContent>
<!-- the encoding type for tidy. Default is Raw, options are ASCII, Raw, Latin1, UTF8, ISO2022, MacroMan-->
<TidyCharEncoding>Raw</TidyCharEncoding>
<!-- Enable / disable xml content cache -->
<XmlCacheEnabled>True</XmlCacheEnabled>

View File

@@ -5,6 +5,7 @@ using Moq;
using NUnit.Framework;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Manifest;
using Umbraco.Core.PropertyEditors;
@@ -21,7 +22,7 @@ namespace Umbraco.Tests.Manifest
[SetUp]
public void Setup()
{
_parser = new ManifestParser(Mock.Of<ILogger>(), new DirectoryInfo(TestHelper.MapPathForTest("~/App_Plugins")));
_parser = new ManifestParser(Mock.Of<ILogger>(), new DirectoryInfo(IOHelper.MapPath("~/App_Plugins")));
}
[Test]

View File

@@ -14,6 +14,7 @@ using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Manifest;
using Umbraco.Core.Models.PublishedContent;
@@ -205,7 +206,7 @@ namespace Umbraco.Tests.TestHelpers
PropertyEditorResolver.Current = new PropertyEditorResolver(
Container, Logger,
() => PluginManager.Current.ResolvePropertyEditors(),
new ManifestBuilder(new ManifestParser(Logger, new DirectoryInfo(TestHelper.MapPathForTest("~/App_Plugins")))));
new ManifestBuilder(new ManifestParser(Logger, new DirectoryInfo(IOHelper.MapPath("~/App_Plugins")))));
MappingResolver.Current = new MappingResolver(
Container, Logger,

View File

@@ -66,7 +66,9 @@ namespace Umbraco.Tests.TestHelpers
Container.Register<ILogger>(factory => Logger);
Container.Register<CacheHelper>(factory => CacheHelper);
Container.Register<ProfilingLogger>(factory => ProfilingLogger);
var settings = SettingsForTests.GetDefault();
Container.Register<IUmbracoSettingsSection>(factory => SettingsForTests.GetDefault(), new PerContainerLifetime());
Container.Register<IContentSection>(factory => settings.Content, new PerContainerLifetime());
Container.Register<IRuntimeCacheProvider>(factory => CacheHelper.RuntimeCache);
Container.Register<IServiceProvider, ActivatorServiceProvider>();

View File

@@ -2,6 +2,7 @@ using System;
using System.IO;
using System.Web.Routing;
using System.Xml;
using Moq;
using NUnit.Framework;
using SQLCE4Umbraco;
using Umbraco.Core;
@@ -77,5 +78,14 @@ namespace Umbraco.Tests.TestHelpers
</root>";
}
/// <summary>
/// sets up resolvers before resolution is frozen
/// </summary>
protected override void FreezeResolution()
{
Container.Register<MediaFileSystem>(factory => new MediaFileSystem(Mock.Of<IFileSystem>()));
base.FreezeResolution();
}
}
}