PublishedContent - the big refactoring
This commit is contained in:
@@ -93,7 +93,7 @@ namespace Umbraco.Tests.CodeFirst
|
||||
|
||||
//Using this attribute to hide Properties from Intellisense (when compiled?)
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public ICollection<IPublishedContentProperty> Properties
|
||||
public ICollection<IPublishedProperty> Properties
|
||||
{
|
||||
get { return _content.Properties; }
|
||||
}
|
||||
@@ -107,7 +107,7 @@ namespace Umbraco.Tests.CodeFirst
|
||||
|
||||
//Using this attribute to hide Properties from Intellisense (when compiled?)
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public IPublishedContentProperty GetProperty(string alias)
|
||||
public IPublishedProperty GetProperty(string alias)
|
||||
{
|
||||
return _content.GetProperty(alias);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
using System.IO;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Tests.CodeFirst.TestModels;
|
||||
using Umbraco.Tests.PublishedContent;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
@@ -58,9 +62,33 @@ namespace Umbraco.Tests.CodeFirst
|
||||
#region Test setup
|
||||
public override void Initialize()
|
||||
{
|
||||
// required so we can access property.Value
|
||||
//PropertyValueConvertersResolver.Current = new PropertyValueConvertersResolver();
|
||||
|
||||
TestHelper.EnsureUmbracoSettingsConfig();
|
||||
|
||||
base.Initialize();
|
||||
|
||||
// need to specify a custom callback for unit tests
|
||||
// AutoPublishedContentTypes generates properties automatically
|
||||
// when they are requested, but we must declare those that we
|
||||
// explicitely want to be here...
|
||||
|
||||
var propertyTypes = new[]
|
||||
{
|
||||
// AutoPublishedContentType will auto-generate other properties
|
||||
new PublishedPropertyType("siteDescription", Guid.Empty, 0, 0),
|
||||
new PublishedPropertyType("siteName", Guid.Empty, 0, 0),
|
||||
new PublishedPropertyType("articleContent", Guid.Empty, 0, 0),
|
||||
new PublishedPropertyType("articleAuthor", Guid.Empty, 0, 0),
|
||||
new PublishedPropertyType("articleDate", Guid.Empty, 0, 0),
|
||||
new PublishedPropertyType("pageTitle", Guid.Empty, 0, 0),
|
||||
};
|
||||
var type = new AutoPublishedContentType(0, "anything", propertyTypes);
|
||||
PublishedContentType.GetPublishedContentTypeCallback = (alias) => type;
|
||||
Console.WriteLine("INIT STRONG {0}",
|
||||
PublishedContentType.Get(PublishedItemType.Content, "anything")
|
||||
.PropertyTypes.Count());
|
||||
}
|
||||
|
||||
public override void TearDown()
|
||||
|
||||
@@ -10,6 +10,8 @@ namespace Umbraco.Tests.CodeFirst.TestModels
|
||||
[PropertyType(typeof(TextFieldDataType))]
|
||||
public string SiteName { get; set; }
|
||||
|
||||
// fixme - yet the property alias is "siteDescription"?
|
||||
|
||||
[Alias("umbSiteDescription", Name = "Site Description")]
|
||||
[PropertyType(typeof(textfieldMultipleDataType))]
|
||||
public string SiteDescription { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user