using Umbraco.Core; using Umbraco.Core.DI; using Umbraco.Core.Models.PublishedContent; using Umbraco.Core.PropertyEditors; using Umbraco.Core.PropertyEditors.ValueConverters; using Umbraco.Tests.TestHelpers; using Umbraco.Web; namespace Umbraco.Tests.PublishedContent { /// /// Abstract base class for tests for published content and published media /// public abstract class PublishedContentTestBase : BaseRoutingTest { public override void Initialize() { base.Initialize(); // need to specify a custom callback for unit tests var propertyTypes = new[] { // AutoPublishedContentType will auto-generate other properties new PublishedPropertyType("content", 0, Constants.PropertyEditors.TinyMCEAlias), }; var type = new AutoPublishedContentType(0, "anything", propertyTypes); ContentTypesCache.GetPublishedContentTypeByAlias = (alias) => type; var rCtx = GetRoutingContext("/test", 1234); Umbraco.Web.Current.SetUmbracoContext(rCtx.UmbracoContext, true); } protected override void FreezeResolution() { // fixme - what about the if (PropertyValueConvertersResolver.HasCurrent == false) ?? // can we risk double - registering and then, what happens? Container.RegisterCollectionBuilder() .Append() .Append() .Append(); base.FreezeResolution(); } } }