fixes tests

This commit is contained in:
Shannon
2017-02-09 12:07:16 +11:00
parent 97e8973cbd
commit b7578e2b98
3 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -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);
+3 -2
View File
@@ -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