From 52640a94eece09373a8f0942cc5feff8302cbfd4 Mon Sep 17 00:00:00 2001 From: Stephan Date: Fri, 11 Oct 2013 12:05:52 +0200 Subject: [PATCH] Fix tests after merge --- .../DynamicDocumentTestsBase.cs | 8 ++++++- .../PublishedContent/PublishedContentTests.cs | 23 +++++-------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/Umbraco.Tests/PublishedContent/DynamicDocumentTestsBase.cs b/src/Umbraco.Tests/PublishedContent/DynamicDocumentTestsBase.cs index 7c0ca0eaab..c41a8709f6 100644 --- a/src/Umbraco.Tests/PublishedContent/DynamicDocumentTestsBase.cs +++ b/src/Umbraco.Tests/PublishedContent/DynamicDocumentTestsBase.cs @@ -544,6 +544,11 @@ namespace Umbraco.Tests.PublishedContent { var asDynamic = GetDynamicNode(1174); + // NOTE: that test breaks because of U4-3094 fix in DynamicPublishedContent + // previously, DynamicPublishedContent.GetProperty would honor the '_' and '@' syntax. + // now that it's just using the original proper IPublishedContent way, it does not anymore + // I *think* it makes sense. Then kill that test. Do we all agree? - Stephan + Assert.AreEqual("admin", asDynamic.GetPropertyValue("@creatorName")); Assert.AreEqual("admin", asDynamic.GetPropertyValue("@CreatorName")); } @@ -598,7 +603,8 @@ namespace Umbraco.Tests.PublishedContent Assert.IsNotNull(result); - Assert.AreEqual((int) 1046, (int) result.Id); + // ancestor-or-self has to be self! + Assert.AreEqual(1173, (int)result.Id); } [Test] diff --git a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs index 5b8a745229..ca472db65c 100644 --- a/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs +++ b/src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs @@ -317,24 +317,12 @@ namespace Umbraco.Tests.PublishedContent { var doc = GetNode(1046); - var currentLevel = 0; - var lastSortOrder = 0; - var levelChangesAt = new[] { 1046, 1173, 1174 }; + var expected = new[] {1046, 1173, 1174, 1177, 1178, 1176, 1175, 4444, 1172}; + var exindex = 0; + // must respect the XPath descendants-or-self axis! foreach (var d in doc.DescendantsOrSelf()) - { - if (levelChangesAt.Contains(d.Id)) - { - Assert.Greater(d.Level, currentLevel); - currentLevel = d.Level; - } - else - { - Assert.AreEqual(currentLevel, d.Level); - Assert.Greater(d.SortOrder, lastSortOrder); - } - lastSortOrder = d.SortOrder; - } + Assert.AreEqual(expected[exindex++], d.Id); } [Test] @@ -521,7 +509,8 @@ namespace Umbraco.Tests.PublishedContent Assert.IsNotNull(result); - Assert.AreEqual((int)1046, (int)result.Id); + // ancestor-or-self has to be self! + Assert.AreEqual(1173, result.Id); } [Test]