fixes tests
This commit is contained in:
@@ -1039,7 +1039,8 @@ namespace Umbraco.Core.Services
|
||||
};
|
||||
|
||||
//get descendents to process of the content item that is being moved to trash - must be done before changing the state below
|
||||
var descendants = ignoreDescendants ? Enumerable.Empty<IContent>() : GetDescendants(content).OrderByDescending(x => x.Level);
|
||||
//must be processed with shallowest levels first
|
||||
var descendants = ignoreDescendants ? Enumerable.Empty<IContent>() : GetDescendants(content).OrderBy(x => x.Level);
|
||||
|
||||
//Do the updates for this item
|
||||
var repository = RepositoryFactory.CreateContentRepository(uow);
|
||||
|
||||
@@ -1072,8 +1072,9 @@ namespace Umbraco.Core.Services
|
||||
new MoveEventInfo<IMedia>(media, originalPath, Constants.System.RecycleBinMedia)
|
||||
};
|
||||
|
||||
//get descendents to process of the content item that is being moved to trash - must be done before changing the state below
|
||||
var descendants = ignoreDescendants ? Enumerable.Empty<IMedia>() : GetDescendants(media).OrderByDescending(x => x.Level);
|
||||
//get descendents to process of the content item that is being moved to trash - must be done before changing the state below,
|
||||
//must be processed with shallowest levels first
|
||||
var descendants = ignoreDescendants ? Enumerable.Empty<IMedia>() : GetDescendants(media).OrderBy(x => x.Level);
|
||||
|
||||
//Do the updates for this item
|
||||
var repository = RepositoryFactory.CreateMediaRepository(uow);
|
||||
|
||||
@@ -1319,7 +1319,7 @@ namespace Umbraco.Tests.Services
|
||||
// Assert
|
||||
Assert.That(content.ParentId, Is.EqualTo(-20));
|
||||
Assert.That(content.Trashed, Is.True);
|
||||
Assert.That(descendants.Count(), Is.EqualTo(3));
|
||||
Assert.That(descendants.Count, Is.EqualTo(3));
|
||||
Assert.That(descendants.Any(x => x.Path.Contains("-20") == false), Is.False);
|
||||
|
||||
//Empty Recycle Bin
|
||||
|
||||
Reference in New Issue
Block a user