Refactor content service

This commit is contained in:
Stephan
2017-11-30 13:56:29 +01:00
parent 94127e9aa2
commit 9b9c7c8e3a
81 changed files with 2636 additions and 2710 deletions

View File

@@ -135,7 +135,8 @@ namespace Umbraco.Tests.Scoping
using (var scope = ScopeProvider.CreateScope())
{
Current.Services.ContentService.SaveAndPublishWithStatus(item);
item.PublishValues();
Current.Services.ContentService.SaveAndPublish(item);
scope.Complete();
}
@@ -149,7 +150,8 @@ namespace Umbraco.Tests.Scoping
using (var scope = ScopeProvider.CreateScope())
{
item.Name = "changed";
Current.Services.ContentService.SaveAndPublishWithStatus(item);
item.PublishValues();
Current.Services.ContentService.SaveAndPublish(item);
if (complete)
scope.Complete();

View File

@@ -122,9 +122,11 @@ namespace Umbraco.Tests.Scoping
using (var scope = ScopeProvider.CreateScope())
{
Current.Services.ContentService.SaveAndPublishWithStatus(item); // should create an xml clone
item.PublishValues();
Current.Services.ContentService.SaveAndPublish(item); // should create an xml clone
item.Name = "changed";
Current.Services.ContentService.SaveAndPublishWithStatus(item); // should re-use the xml clone
item.PublishValues();
Current.Services.ContentService.SaveAndPublish(item); // should re-use the xml clone
// this should never change
Assert.AreEqual(beforeOuterXml, beforeXml.OuterXml);
@@ -145,7 +147,7 @@ namespace Umbraco.Tests.Scoping
// note
// this means that, as long as ppl don't create scopes, they'll see their
// changes right after SaveAndPublishWithStatus, but if they create scopes,
// changes right after SaveAndPublish, but if they create scopes,
// they will have to wail until the scope is completed, ie wait until the
// events trigger, to use eg GetUrl etc
@@ -227,12 +229,14 @@ namespace Umbraco.Tests.Scoping
using (var scope = ScopeProvider.CreateScope())
{
Current.Services.ContentService.SaveAndPublishWithStatus(item);
item.PublishValues();
Current.Services.ContentService.SaveAndPublish(item);
for (var i = 0; i < count; i++)
{
var temp = new Content("content_" + i, -1, contentType);
Current.Services.ContentService.SaveAndPublishWithStatus(temp);
temp.PublishValues();
Current.Services.ContentService.SaveAndPublish(temp);
ids[i] = temp.Id;
}