From 5040bbc1b2c996feedda2c4c6e6b64232bccc3e8 Mon Sep 17 00:00:00 2001 From: Matthew Wise <6782865+Matthew-Wise@users.noreply.github.com> Date: Sat, 22 Oct 2022 16:19:13 +0100 Subject: [PATCH] Added asserts to TagsCanBecomeInvariantByPropertyTypeAndBackToVariant --- .../Services/ContentServiceTagsTests.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs index 9179b6cd69..ebf161072d 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTagsTests.cs @@ -392,6 +392,9 @@ public class ContentServiceTagsTests : UmbracoIntegrationTest [Test] public void TagsCanBecomeInvariantByPropertyTypeAndBackToVariant() { + var frValue = new string[] { "hello", "world", "some", "tags", "plus" }; + var enValue = new string[] { "hello", "world", "another", "one" }; + var language = new LanguageBuilder() .WithCultureInfo("fr-FR") .Build(); @@ -409,9 +412,9 @@ public class ContentServiceTagsTests : UmbracoIntegrationTest content1.SetCultureName("name-fr", "fr-FR"); content1.SetCultureName("name-en", "en-US"); content1.AssignTags(PropertyEditorCollection, DataTypeService, Serializer, "tags", - new[] { "hello", "world", "some", "tags", "plus" }, culture: "fr-FR"); + frValue, culture: "fr-FR"); content1.AssignTags(PropertyEditorCollection, DataTypeService, Serializer, "tags", - new[] { "hello", "world", "another", "one" }, culture: "en-US"); + enValue, culture: "en-US"); ContentService.SaveAndPublish(content1); propertyType.Variations = ContentVariation.Nothing; @@ -421,7 +424,8 @@ public class ContentServiceTagsTests : UmbracoIntegrationTest propertyType.Variations = ContentVariation.Culture; ContentTypeService.Save(contentType); - // TODO: Assert results + Assert.AreEqual(frValue, Serializer.Deserialize(content1.GetValue("tags", "fr-FR"))); + Assert.AreEqual(enValue, Serializer.Deserialize(content1.GetValue("tags", "en-US"))); } [Test] @@ -847,7 +851,7 @@ public class ContentServiceTagsTests : UmbracoIntegrationTest IContent content = ContentBuilder.CreateSimpleContent(contentType, "Tagged content"); content.AssignTags(PropertyEditorCollection, DataTypeService, Serializer, "tags", - new[] { "hello,world,tags", "new"}); + new[] { "hello,world,tags", "new" }); ContentService.SaveAndPublish(content); @@ -882,7 +886,7 @@ public class ContentServiceTagsTests : UmbracoIntegrationTest IContent content = ContentBuilder.CreateSimpleContent(contentType, "Tagged content"); content.AssignTags(PropertyEditorCollection, DataTypeService, Serializer, "tags", - new[] { "hello,world,tags", "new"}); + new[] { "hello,world,tags", "new" }); ContentService.SaveAndPublish(content);