Fixes #7798 : Invalid implementation of IEnumerable in Content Cache
This commit is contained in:
committed by
Sebastiaan Janssen
parent
51d7ce0dc6
commit
ff2027df07
@@ -1,9 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
@@ -27,7 +25,6 @@ using Umbraco.Web.Cache;
|
||||
using Umbraco.Web.PublishedCache;
|
||||
using Umbraco.Web.PublishedCache.NuCache;
|
||||
using Umbraco.Web.PublishedCache.NuCache.DataSource;
|
||||
using Umbraco.Web.PublishedCache.NuCache.Snap;
|
||||
|
||||
namespace Umbraco.Tests.PublishedContent
|
||||
{
|
||||
@@ -1312,6 +1309,18 @@ namespace Umbraco.Tests.PublishedContent
|
||||
AssertLinkedNode(child3.contentNode, 1, 3, -1, -1, -1);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MultipleCacheIteration()
|
||||
{
|
||||
//see https://github.com/umbraco/Umbraco-CMS/issues/7798
|
||||
this.Init(this.GetInvariantKits());
|
||||
var snapshot = this._snapshotService.CreatePublishedSnapshot(previewToken: null);
|
||||
this._snapshotAccessor.PublishedSnapshot = snapshot;
|
||||
|
||||
var items = snapshot.Content.GetByXPath("/root/itype");
|
||||
Assert.AreEqual(items.Count(), items.Count());
|
||||
}
|
||||
|
||||
private void AssertLinkedNode(ContentNode node, int parent, int prevSibling, int nextSibling, int firstChild, int lastChild)
|
||||
{
|
||||
Assert.AreEqual(parent, node.ParentContentId);
|
||||
|
||||
@@ -355,6 +355,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
|
||||
|
||||
private static IEnumerable<IPublishedContent> GetByXPath(XPathNodeIterator iterator)
|
||||
{
|
||||
iterator = iterator.Clone();
|
||||
while (iterator.MoveNext())
|
||||
{
|
||||
var xnav = iterator.Current as NavigableNavigator;
|
||||
|
||||
Reference in New Issue
Block a user