Files
Umbraco-CMS/src/Umbraco.Tests/DynamicDocument/DynamicNodeTests.cs
Shannon Deminick 27bcea78d2 Started implementing new IPublishedMediaStore which will replace the notion of the legacy ExamineBackedMedia and
moving forward will open up many nice opportunities. This will be used for the media accessor in the new DynamicDocument.
Renamed XmlPublishedContentStore to just DefaultPublishedContentStore.
Made GetProperty an extension method for IDocument and removed from the interface as it is not needed there.
2012-09-08 13:22:45 +07:00

46 lines
1.4 KiB
C#

using System.IO;
using NUnit.Framework;
using Umbraco.Core.Configuration;
using Umbraco.Tests.TestHelpers;
using Umbraco.Web;
using umbraco.BusinessLogic;
using umbraco.IO;
using umbraco.MacroEngines;
using umbraco.NodeFactory;
using umbraco.cms.businesslogic.template;
using System.Linq;
namespace Umbraco.Tests.DynamicDocument
{
[TestFixture]
public class DynamicNodeTests : DynamicDocumentTestsBase<DynamicNode, DynamicNodeList>
{
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);
}
protected override dynamic GetDynamicNode(int id)
{
var template = Template.MakeNew("test", new User(0));
var ctx = GetUmbracoContext("/test", template.Id);
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;
}
}
}