From d925f856ae3e72de60c7a58fd72a342b6893fc21 Mon Sep 17 00:00:00 2001 From: Stephan Date: Mon, 23 Sep 2013 16:55:59 +0200 Subject: [PATCH] Take care of FIXMEs --- src/Umbraco.Core/CoreBootManager.cs | 2 +- src/Umbraco.Core/Models/IPublishedContent.cs | 2 +- .../Models/PublishedContent/PublishedPropertyType.cs | 5 +++-- .../PropertyEditors/IPropertyEditorValueConverter.cs | 4 ++-- src/Umbraco.Tests/CodeFirst/TestModels/Home.cs | 4 +--- .../ExtensionMethodFinderTests.cs | 10 +++++----- .../PublishedContent/PublishedContentDataTableTests.cs | 6 ++++-- .../PublishedContent/PublishedContentTestElements.cs | 2 +- .../Routing/ContentFinderByAliasWithDomainsTests.cs | 4 ++-- 9 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/Umbraco.Core/CoreBootManager.cs b/src/Umbraco.Core/CoreBootManager.cs index 1f5db6eb44..2311242319 100644 --- a/src/Umbraco.Core/CoreBootManager.cs +++ b/src/Umbraco.Core/CoreBootManager.cs @@ -258,7 +258,7 @@ namespace Umbraco.Core MigrationResolver.Current = new MigrationResolver( () => PluginManager.Current.ResolveMigrationTypes()); - // fixme - remove support for obsolete PropertyEditorValueConverter + // todo: remove once we drop IPropertyEditorValueConverter support. PropertyEditorValueConvertersResolver.Current = new PropertyEditorValueConvertersResolver( PluginManager.Current.ResolvePropertyEditorValueConverters()); diff --git a/src/Umbraco.Core/Models/IPublishedContent.cs b/src/Umbraco.Core/Models/IPublishedContent.cs index 1e56cb5822..854ddfd47d 100644 --- a/src/Umbraco.Core/Models/IPublishedContent.cs +++ b/src/Umbraco.Core/Models/IPublishedContent.cs @@ -148,7 +148,7 @@ namespace Umbraco.Core.Models /// The recursive syntax (eg "_title") is _not_ supported here. /// The alias is case-insensitive. /// - object this[string alias] { get; } // fixme - should obsolete this[alias] + object this[string alias] { get; } // todo - should obsolete this[alias] (when?) #endregion } diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs index 2703c83892..554b6bcfa8 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs @@ -86,7 +86,7 @@ namespace Umbraco.Core.Models.PublishedContent { var converters = PropertyValueConvertersResolver.Current.Converters.ToArray(); - // fixme - get rid of the IPropertyValueEditorConverter support eventually + // todo: remove Union() once we drop IPropertyEditorValueConverter support. _converter = null; foreach (var converter in converters.Union(GetCompatConverters()).Where(x => x.IsConverter(this))) { @@ -206,8 +206,9 @@ namespace Umbraco.Core.Models.PublishedContent #region Compat - // fixme - remove in v7 // backward-compatibility: support IPropertyEditorValueConverter while we have to + // todo: remove once we drop IPropertyEditorValueConverter support. + IEnumerable GetCompatConverters() { return PropertyEditorValueConvertersResolver.HasCurrent diff --git a/src/Umbraco.Core/PropertyEditors/IPropertyEditorValueConverter.cs b/src/Umbraco.Core/PropertyEditors/IPropertyEditorValueConverter.cs index f816b85437..3f47c09e4a 100644 --- a/src/Umbraco.Core/PropertyEditors/IPropertyEditorValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/IPropertyEditorValueConverter.cs @@ -5,8 +5,8 @@ namespace Umbraco.Core.PropertyEditors /// /// Maps a property source value to a data object. /// - // fixme - should obsolete that class - public interface IPropertyEditorValueConverter + // todo: drop IPropertyEditorValueConverter support (when?). + public interface IPropertyEditorValueConverter { /// /// Returns a value indicating whether this provider applies to the specified property. diff --git a/src/Umbraco.Tests/CodeFirst/TestModels/Home.cs b/src/Umbraco.Tests/CodeFirst/TestModels/Home.cs index 637400ef1e..e874e5a3b1 100644 --- a/src/Umbraco.Tests/CodeFirst/TestModels/Home.cs +++ b/src/Umbraco.Tests/CodeFirst/TestModels/Home.cs @@ -10,9 +10,7 @@ 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")] + [Alias("umbSiteDescription", Name = "Site Description")] // ignored by the mapper at the moment [PropertyType(typeof(textfieldMultipleDataType))] public string SiteDescription { get; set; } } diff --git a/src/Umbraco.Tests/DynamicsAndReflection/ExtensionMethodFinderTests.cs b/src/Umbraco.Tests/DynamicsAndReflection/ExtensionMethodFinderTests.cs index 6736ab0289..003eb31d78 100644 --- a/src/Umbraco.Tests/DynamicsAndReflection/ExtensionMethodFinderTests.cs +++ b/src/Umbraco.Tests/DynamicsAndReflection/ExtensionMethodFinderTests.cs @@ -78,13 +78,13 @@ namespace Umbraco.Tests.DynamicsAndReflection var m5 = typeof(ExtensionMethodFinderTests).GetMethod("TestMethod5"); - // fixme - currently that fails because we can't match List with List + // note - currently that fails because we can't match List with List var a5 = new object[] {new List()}; var m5A = GetMethodForArguments(m5, a5); Assert.IsNotNull(m5A); - // fixme - should we also handle "ref" and "out" parameters? - // fixme - should we pay attention to array types? + // note - should we also handle "ref" and "out" parameters? + // note - should we pay attention to array types? } public void TestMethod1(int value) {} @@ -122,7 +122,7 @@ namespace Umbraco.Tests.DynamicsAndReflection var pos = parameterType.GenericParameterPosition; if (genericArgumentTypes[pos] != null) { - // fixme - is this OK? what about variance and such? + // note - is this OK? what about variance and such? // it is NOT ok, if the first pass is SomethingElse then next is Something // it will fail... the specs prob. indicate how it works, trying to find a common // type... @@ -172,7 +172,7 @@ namespace Umbraco.Tests.DynamicsAndReflection method.Invoke(null, new object[] { class1, 1 }); method = ExtensionMethodFinder.FindExtensionMethod(typeof(Class1), new object[] { "x" }, "TestMethod1", false); - Assert.IsNull(method); // fixme - fails, return TestMethod1! + Assert.IsNull(method); // note - fails, return TestMethod1! method = ExtensionMethodFinder.FindExtensionMethod(typeof(Class1), new object[] { 1 }, "TestMethod2", false); Assert.IsNotNull(method); diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs index 79ad0891ba..5d4cca261a 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentDataTableTests.cs @@ -126,6 +126,7 @@ namespace Umbraco.Tests.PublishedContent private IPublishedContent GetContent(bool createChildren, int indexVals) { var contentTypeAlias = createChildren ? "Parent" : "Child"; + var z = new SolidPublishedContent(null;) var d = new TestPublishedContent { CreateDate = DateTime.Now, @@ -174,7 +175,8 @@ namespace Umbraco.Tests.PublishedContent return d; } - // fixme - why can't we just use SolidPublishedContent here? + // note - could probably rewrite those tests using SolidPublishedContentCache + // l8tr... private class TestPublishedContent : IPublishedContent { public string Url { get; set; } @@ -214,7 +216,7 @@ namespace Umbraco.Tests.PublishedContent public object this[string propertyAlias] { - get { return GetProperty(propertyAlias).DataValue; } // fixme - why DataValue here? + get { return GetProperty(propertyAlias).ObjectValue; } } public IEnumerable Children { get; set; } diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTestElements.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTestElements.cs index 86b32b2d50..9ec15c66d5 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentTestElements.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTestElements.cs @@ -149,7 +149,7 @@ namespace Umbraco.Tests.PublishedContent { var index = this.Siblings().FindIndex(x => x.Id == Id); if (index < 0) - throw new IndexOutOfRangeException(""); // fixme + throw new IndexOutOfRangeException("Failed to find content in its siblings collection?!"); return index; } diff --git a/src/Umbraco.Tests/Routing/ContentFinderByAliasWithDomainsTests.cs b/src/Umbraco.Tests/Routing/ContentFinderByAliasWithDomainsTests.cs index 0636b3828f..a45ac7a12b 100644 --- a/src/Umbraco.Tests/Routing/ContentFinderByAliasWithDomainsTests.cs +++ b/src/Umbraco.Tests/Routing/ContentFinderByAliasWithDomainsTests.cs @@ -52,9 +52,9 @@ namespace Umbraco.Tests.Routing } - [TestCase("http://domain1.com/this/is/my/alias", "de-DE", -1001)] // alias to domain's page fails FIXME wanted? + [TestCase("http://domain1.com/this/is/my/alias", "de-DE", -1001)] // alias to domain's page fails - no alias on domain's home [TestCase("http://domain1.com/page2/alias", "de-DE", 10011)] // alias to sub-page works - [TestCase("http://domain1.com/en/flux", "en-US", -10011)] // alias to domain's page fails FIXME wanted? + [TestCase("http://domain1.com/en/flux", "en-US", -10011)] // alias to domain's page fails - no alias on domain's home [TestCase("http://domain1.com/endanger", "de-DE", 10011)] // alias to sub-page works, even with "en..." [TestCase("http://domain1.com/en/endanger", "en-US", -10011)] // no [TestCase("http://domain1.com/only/one/alias", "de-DE", 100111)] // ok