Fix tests, a culture is not edited if not available
This commit is contained in:
@@ -430,14 +430,15 @@ namespace Umbraco.Tests.Models
|
||||
Assert.IsTrue(content.IsCultureAvailable(langUk));
|
||||
Assert.IsFalse(content.IsCulturePublished(langUk));
|
||||
Assert.IsNull(content.GetPublishName(langUk));
|
||||
Assert.IsNull(content.GetPublishDate(langUk)); // not published
|
||||
Assert.IsTrue(content.IsCultureEdited(langEs)); // not published, so... edited
|
||||
Assert.IsNull(content.GetPublishDate(langUk)); // not published
|
||||
|
||||
Assert.IsFalse(content.IsCultureAvailable(langEs));
|
||||
Assert.IsFalse(content.IsCultureEdited(langEs)); // not avail, so... not edited
|
||||
Assert.IsFalse(content.IsCulturePublished(langEs));
|
||||
|
||||
// not published!
|
||||
Assert.IsNull(content.GetPublishName(langEs));
|
||||
Assert.IsNull(content.GetPublishDate(langEs)); // not published!
|
||||
Assert.IsTrue(content.IsCultureEdited(langEs)); // not published, so... edited
|
||||
Assert.IsNull(content.GetPublishDate(langEs));
|
||||
|
||||
// cannot test IsCultureEdited here - as that requires the content service and repository
|
||||
// see: ContentServiceTests.Can_SaveRead_Variations
|
||||
|
||||
@@ -2624,9 +2624,9 @@ namespace Umbraco.Tests.Services
|
||||
AssertPerCulture(content, (x, c) => x.IsCulturePublished(c), (langFr, false), (langUk, false), (langDe, false));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCulturePublished(c), (langFr, false), (langUk, false), (langDe, false));
|
||||
|
||||
// not published => must be edited
|
||||
AssertPerCulture(content, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, true));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, true));
|
||||
// not published => must be edited, if available
|
||||
AssertPerCulture(content, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, false));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, false));
|
||||
|
||||
// act
|
||||
|
||||
@@ -2666,8 +2666,8 @@ namespace Umbraco.Tests.Services
|
||||
AssertPerCulture(content2, (x, c) => x.IsCulturePublished(c), (langFr, true), (langUk, true), (langDe, false));
|
||||
|
||||
// fr and uk, published without changes, not edited
|
||||
AssertPerCulture(content, (x, c) => x.IsCultureEdited(c), (langFr, false), (langUk, false), (langDe, true));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCultureEdited(c), (langFr, false), (langUk, false), (langDe, true));
|
||||
AssertPerCulture(content, (x, c) => x.IsCultureEdited(c), (langFr, false), (langUk, false), (langDe, false));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCultureEdited(c), (langFr, false), (langUk, false), (langDe, false));
|
||||
|
||||
AssertPerCulture(content, (x, c) => x.GetPublishDate(c) == DateTime.MinValue, (langFr, false), (langUk, false)); // DE would throw
|
||||
AssertPerCulture(content2, (x, c) => x.GetPublishDate(c) == DateTime.MinValue, (langFr, false), (langUk, false)); // DE would throw
|
||||
@@ -2726,8 +2726,8 @@ namespace Umbraco.Tests.Services
|
||||
AssertPerCulture(content2, (x, c) => x.IsCulturePublished(c), (langFr, true), (langUk, true), (langDe, false));
|
||||
|
||||
// we have changed values so now fr and uk are edited
|
||||
AssertPerCulture(content, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, true));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, true));
|
||||
AssertPerCulture(content, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, false));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, false));
|
||||
|
||||
AssertPerCulture(content, (x, c) => x.GetPublishDate(c) == DateTime.MinValue, (langFr, false), (langUk, false)); // DE would throw
|
||||
AssertPerCulture(content2, (x, c) => x.GetPublishDate(c) == DateTime.MinValue, (langFr, false), (langUk, false)); // DE would throw
|
||||
@@ -2770,8 +2770,8 @@ namespace Umbraco.Tests.Services
|
||||
AssertPerCulture(content2, (x, c) => x.IsCulturePublished(c), (langFr, false), (langUk, true), (langDe, false));
|
||||
|
||||
// and so, fr has to be edited
|
||||
AssertPerCulture(content, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, true));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, true));
|
||||
AssertPerCulture(content, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, false));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, false));
|
||||
|
||||
AssertPerCulture(content, (x, c) => x.GetPublishDate(c) == DateTime.MinValue, (langUk, false)); // FR, DE would throw
|
||||
AssertPerCulture(content2, (x, c) => x.GetPublishDate(c) == DateTime.MinValue, (langUk, false)); // FR, DE would throw
|
||||
@@ -2817,8 +2817,8 @@ namespace Umbraco.Tests.Services
|
||||
AssertPerCulture(content2, (x, c) => x.IsCulturePublished(c), (langFr, false), (langUk, true), (langDe, false));
|
||||
|
||||
// and so, fr has to be edited - uk still is
|
||||
AssertPerCulture(content, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, true));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, true));
|
||||
AssertPerCulture(content, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, false));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, false));
|
||||
|
||||
AssertPerCulture(content, (x, c) => x.GetPublishDate(c) == DateTime.MinValue, (langUk, false)); // FR, DE would throw
|
||||
AssertPerCulture(content2, (x, c) => x.GetPublishDate(c) == DateTime.MinValue, (langUk, false)); // FR, DE would throw
|
||||
@@ -2859,8 +2859,8 @@ namespace Umbraco.Tests.Services
|
||||
AssertPerCulture(content2, (x, c) => x.IsCulturePublished(c), (langFr, false), (langUk, true), (langDe, false));
|
||||
|
||||
// no change, back to published
|
||||
AssertPerCulture(content, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, true));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, true));
|
||||
AssertPerCulture(content, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, false));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, true), (langDe, false));
|
||||
|
||||
AssertPerCulture(content, (x, c) => x.GetPublishDate(c) == DateTime.MinValue, (langUk, false)); // FR, DE would throw
|
||||
AssertPerCulture(content2, (x, c) => x.GetPublishDate(c) == DateTime.MinValue, (langUk, false)); // FR, DE would throw
|
||||
@@ -2882,8 +2882,8 @@ namespace Umbraco.Tests.Services
|
||||
AssertPerCulture(content2, (x, c) => x.IsCulturePublished(c), (langFr, false), (langUk, true), (langDe, false));
|
||||
|
||||
// now, uk is no more edited
|
||||
AssertPerCulture(content, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, false), (langDe, true));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, false), (langDe, true));
|
||||
AssertPerCulture(content, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, false), (langDe, false));
|
||||
AssertPerCulture(content2, (x, c) => x.IsCultureEdited(c), (langFr, true), (langUk, false), (langDe, false));
|
||||
|
||||
AssertPerCulture(content, (x, c) => x.GetPublishDate(c) == DateTime.MinValue, (langUk, false)); // FR, DE would throw
|
||||
AssertPerCulture(content2, (x, c) => x.GetPublishDate(c) == DateTime.MinValue, (langUk, false)); // FR, DE would throw
|
||||
|
||||
Reference in New Issue
Block a user