diff --git a/src/Umbraco.Core/Extensions/PublishedContentExtensions.cs b/src/Umbraco.Core/Extensions/PublishedContentExtensions.cs index 5139e23af964..7dde30fb9899 100644 --- a/src/Umbraco.Core/Extensions/PublishedContentExtensions.cs +++ b/src/Umbraco.Core/Extensions/PublishedContentExtensions.cs @@ -999,10 +999,12 @@ public static IEnumerable DescendantsOrSelfOfType( /// /// /// Variation context accessor. + /// /// /// The specific culture to filter for. If null is used the current culture is used. (Default is /// null) /// + /// /// /// /// This can be useful in order to return all nodes in an entire site by a type when combined with TypedContentAtRoot @@ -1357,6 +1359,7 @@ public static IEnumerable Children( /// Gets the children of the content, of any of the specified types. /// /// The content. + /// /// /// The accessor for the VariationContext /// @@ -1364,7 +1367,6 @@ public static IEnumerable Children( /// null) /// /// The content type alias. - /// /// The children of the content, of any of the specified types. public static IEnumerable ChildrenOfType( this IPublishedContent content, @@ -1382,10 +1384,12 @@ public static IEnumerable ChildrenOfType( /// The content type. /// The content. /// The accessor for the VariationContext + /// /// /// The specific culture to filter for. If null is used the current culture is used. (Default is /// null) /// + /// /// The children of content, of the given content type. /// /// Children are sorted by their sortOrder. @@ -1488,12 +1492,13 @@ public static IEnumerable Siblings( /// Gets the siblings of the content, of a given content type. /// /// The content. - /// Published snapshot instance /// Variation context accessor. /// /// The specific culture to filter for. If null is used the current culture is used. (Default is /// null) /// + /// + /// /// The content type alias. /// The siblings of the content, of the given content type. /// @@ -1514,8 +1519,9 @@ public static IEnumerable SiblingsOfType( /// /// The content type. /// The content. - /// Published snapshot instance /// Variation context accessor. + /// + /// /// /// The specific culture to filter for. If null is used the current culture is used. (Default is /// null) @@ -1577,13 +1583,14 @@ public static IEnumerable Siblings( /// Gets the siblings of the content including the node itself to indicate the position, of a given content type. /// /// The content. - /// Published snapshot instance /// Variation context accessor. /// /// The specific culture to filter for. If null is used the current culture is used. (Default is /// null) /// + /// /// The content type alias. + /// /// The siblings of the content including the node itself, of the given content type. public static IEnumerable SiblingsAndSelfOfType( this IPublishedContent content, @@ -1593,7 +1600,6 @@ public static IEnumerable SiblingsAndSelfOfType( string contentTypeAlias, string? culture = null) { - var parentSuccess = navigationQueryService.TryGetParentKey(content.Key, out Guid? parentKey); IPublishedContent? parent = parentKey is null ? null : publishedCache.GetById(parentKey.Value); @@ -1620,12 +1626,13 @@ public static IEnumerable SiblingsAndSelfOfType( /// /// The content type. /// The content. - /// Published snapshot instance /// Variation context accessor. + /// /// /// The specific culture to filter for. If null is used the current culture is used. (Default is /// null) /// + /// /// The siblings of the content including the node itself, of the given content type. public static IEnumerable SiblingsAndSelf( this IPublishedContent content, @@ -1728,6 +1735,7 @@ public static string GetWriterName(this IPublishedContent content, IUserService /// /// The content. /// Variation context accessor. + /// /// The content type service. /// The media type service. /// The member type service. @@ -1737,6 +1745,7 @@ public static string GetWriterName(this IPublishedContent content, IUserService /// The specific culture to filter for. If null is used the current culture is used. (Default is /// null) /// + /// /// The children of the content. public static DataTable ChildrenAsTable( this IPublishedContent content, @@ -1756,6 +1765,7 @@ public static DataTable ChildrenAsTable( /// /// The content. /// Variation context accessor. + /// /// The content type service. /// The media type service. /// The member type service. @@ -1765,6 +1775,7 @@ public static DataTable ChildrenAsTable( /// The specific culture to filter for. If null is used the current culture is used. (Default is /// null) /// + /// /// The children of the content. private static DataTable GenerateDataTable( IPublishedContent content, diff --git a/src/Umbraco.Core/Models/PublishedContent/IPublishedMemberCache.cs b/src/Umbraco.Core/Models/PublishedContent/IPublishedMemberCache.cs index 11cb52a57ddf..f7902676b743 100644 --- a/src/Umbraco.Core/Models/PublishedContent/IPublishedMemberCache.cs +++ b/src/Umbraco.Core/Models/PublishedContent/IPublishedMemberCache.cs @@ -30,8 +30,6 @@ public interface IPublishedMemberCache /// /// Get an from an /// - /// The key of the member to fetch - /// Will fetch draft if this is set to true /// Task GetAsync(IMember member); } diff --git a/src/Umbraco.Core/Services/IDocumentUrlService.cs b/src/Umbraco.Core/Services/IDocumentUrlService.cs index e5d2c0df7a5a..3aa0811cd457 100644 --- a/src/Umbraco.Core/Services/IDocumentUrlService.cs +++ b/src/Umbraco.Core/Services/IDocumentUrlService.cs @@ -6,10 +6,10 @@ namespace Umbraco.Cms.Core.Services; public interface IDocumentUrlService { - /// /// Initializes the service and ensure the content in the database is correct with the current configuration. /// + /// /// /// Task InitAsync(bool forceEmpty, CancellationToken cancellationToken); diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index a05649bb3fa4..abd7ea6b826d 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -13,12 +13,12 @@ [SA1111] adjust parenthesis, [SA1649] file name match type name, [CA2017] match parameters number, [CS0108] hidden inherited member, [CS0649] default value always null, [CS1574] unresolveable cref, [CS1998] remove async or make method synchronous, [CS8073] result always true/false, [IDE0060] - remove unused parameter, [IDE1006] naming prefix, [SA1306] fieold name, [CS1723] XML TEntity, - [CS0419] ambiguous cref, and remove overrides --> + remove unused parameter, [IDE1006] naming prefix, [SA1306] field name, [CS1723] XML TEntity, + [CS0419] ambiguous cref, [CS0612] obsolete, and remove overrides --> SA1117,SA1401,SA1134,SA1649,CS0618,CS0067,SA1405,SA1600,CS0168,CS0169,CS0183,SYSLIB0045,SYSLIB0051, - SYSLIB0044,SYSLIB0023,SYSLIB0003,SA1111,SA1649,CA2017,CS0108,CS0649,CS0672,CS1574,CS1998,CS8073,IDE0060, - IDE1006,SA1306,CS1723,CS0419 + SYSLIB0044,SYSLIB0023,SYSLIB0003,SA1111,SA1649,CA2017,CS0108,CS0612,CS0649,CS0672,CS1574,CS1998,CS8073, + IDE0060,IDE1006,SA1306,CS1723,CS0419 diff --git a/src/Umbraco.Core/Web/IUmbracoContext.cs b/src/Umbraco.Core/Web/IUmbracoContext.cs index a481d0352a31..35c4fe64ad8d 100644 --- a/src/Umbraco.Core/Web/IUmbracoContext.cs +++ b/src/Umbraco.Core/Web/IUmbracoContext.cs @@ -59,11 +59,4 @@ public interface IUmbracoContext : IDisposable /// Gets a value indicating whether the current user is in a preview mode and browsing the site (ie. not in the admin UI) /// bool InPreviewMode { get; } - - // TODO: Do we need this? - /// - /// Forces the context into preview - /// - /// A instance to be disposed to exit the preview context - // IDisposable ForcedPreview(bool preview); } diff --git a/src/Umbraco.Infrastructure/Examine/ExamineExtensions.cs b/src/Umbraco.Infrastructure/Examine/ExamineExtensions.cs index afefb4e8e801..509b4ca4b2cf 100644 --- a/src/Umbraco.Infrastructure/Examine/ExamineExtensions.cs +++ b/src/Umbraco.Infrastructure/Examine/ExamineExtensions.cs @@ -51,8 +51,7 @@ public static IEnumerable ToPublishedSearchResults( } /// - /// Creates an containing all content, media or members from the - /// . + /// Creates an containing all content, media or members from the snapshot. /// /// The search results. /// The caches. diff --git a/src/Umbraco.Infrastructure/Persistence/NPocoSqlExtensions.cs b/src/Umbraco.Infrastructure/Persistence/NPocoSqlExtensions.cs index bcfc0a66c310..0ef043509062 100644 --- a/src/Umbraco.Infrastructure/Persistence/NPocoSqlExtensions.cs +++ b/src/Umbraco.Infrastructure/Persistence/NPocoSqlExtensions.cs @@ -67,6 +67,7 @@ public static Sql WhereIn(this Sql sql, Expressi /// The Sql statement. /// An expression specifying the field. /// The values. + /// /// The Sql statement. public static Sql WhereIn(this Sql sql, Expression> field, IEnumerable? values, string alias) { diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/LocalFileSystemTemporaryFileRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/LocalFileSystemTemporaryFileRepository.cs index 7562e8968991..409c2d8c915b 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/LocalFileSystemTemporaryFileRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/LocalFileSystemTemporaryFileRepository.cs @@ -71,8 +71,6 @@ private DirectoryInfo GetRootDirectory() public async Task SaveAsync(TemporaryFileModel model) { - ArgumentNullException.ThrowIfNull(nameof(model)); - // Ensure folder does not exist await DeleteAsync(model.Key); diff --git a/src/Umbraco.Infrastructure/Security/BackOfficeIdentityUser.cs b/src/Umbraco.Infrastructure/Security/BackOfficeIdentityUser.cs index bc7ce7c4bca2..634641723bc5 100644 --- a/src/Umbraco.Infrastructure/Security/BackOfficeIdentityUser.cs +++ b/src/Umbraco.Infrastructure/Security/BackOfficeIdentityUser.cs @@ -125,6 +125,7 @@ public UserKind Kind /// /// /// + /// public static BackOfficeIdentityUser CreateNew(GlobalSettings globalSettings, string? username, string email, string culture, string? name = null, Guid? id = null, UserKind kind = UserKind.Default) { if (string.IsNullOrWhiteSpace(username)) diff --git a/tests/Umbraco.Tests.Common/Builders/Extensions/BuilderExtensions.cs b/tests/Umbraco.Tests.Common/Builders/Extensions/BuilderExtensions.cs index a44c5c7ba9ae..accee29baef8 100644 --- a/tests/Umbraco.Tests.Common/Builders/Extensions/BuilderExtensions.cs +++ b/tests/Umbraco.Tests.Common/Builders/Extensions/BuilderExtensions.cs @@ -232,8 +232,7 @@ public static T WithSupportsPublishing(this T builder, bool supportsPublishin return builder; } - public static T WithPropertyValues(this T builder, object propertyValues, string? culture = null, - string? segment = null) + public static T WithPropertyValues(this T builder, object propertyValues, string? culture = null, string? segment = null) where T : IWithPropertyValues { builder.PropertyValues = propertyValues; diff --git a/tests/Umbraco.Tests.Common/Builders/MediaTypeEditingBuilder.cs b/tests/Umbraco.Tests.Common/Builders/MediaTypeEditingBuilder.cs index c1291d64db2f..eae219ecd1f7 100644 --- a/tests/Umbraco.Tests.Common/Builders/MediaTypeEditingBuilder.cs +++ b/tests/Umbraco.Tests.Common/Builders/MediaTypeEditingBuilder.cs @@ -41,8 +41,7 @@ public static MediaTypeCreateModel CreateBasicMediaType(string alias = "umbImage .Build(); } - public static MediaTypeCreateModel CreateBasicFolderMediaType(string alias = "basicFolder", - string name = "BasicFolder") + public static MediaTypeCreateModel CreateBasicFolderMediaType(string alias = "basicFolder", string name = "BasicFolder") { var builder = new MediaTypeEditingBuilder(); return (MediaTypeCreateModel)builder diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockListElementLevelVariationTests.Publishing.cs b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockListElementLevelVariationTests.Publishing.cs index 29131e4fa6c3..87a16c170ab2 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockListElementLevelVariationTests.Publishing.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/PropertyEditors/BlockListElementLevelVariationTests.Publishing.cs @@ -835,46 +835,45 @@ public async Task Can_Publish_With_Blocks_Removed() Guid.NewGuid(), Guid.NewGuid(), new BlockProperty( - new List { + new List + { new() { Alias = "invariantText", Value = "#1: The first invariant content value" }, new() { Alias = "variantText", Value = "#1: The first content value in English", Culture = "en-US" }, new() { Alias = "variantText", Value = "#1: The first content value in Danish", Culture = "da-DK" } }, [], null, - null - ) + null) ), ( Guid.NewGuid(), Guid.NewGuid(), new BlockProperty( - new List { + new List + { new() { Alias = "invariantText", Value = "#2: The first invariant content value" }, new() { Alias = "variantText", Value = "#2: The first content value in English", Culture = "en-US" }, new() { Alias = "variantText", Value = "#2: The first content value in Danish", Culture = "da-DK" } }, [], null, - null - ) + null) ), ( Guid.NewGuid(), Guid.NewGuid(), new BlockProperty( - new List { + new List + { new() { Alias = "invariantText", Value = "#3: The first invariant content value" }, new() { Alias = "variantText", Value = "#3: The first content value in English", Culture = "en-US" }, new() { Alias = "variantText", Value = "#3: The first content value in Danish", Culture = "da-DK" } }, [], null, - null - ) + null) ), - ] - ); + ]); content.Properties["blocks"]!.SetValue(JsonSerializer.Serialize(blockListValue)); ContentService.Save(content); @@ -984,18 +983,17 @@ public async Task Can_Publish_With_Blocks_In_One_Language() firstBlockContentElementKey, firstBlockSettingsElementKey, new BlockProperty( - new List { + new List + { new() { Alias = "invariantText", Value = "#1: The first invariant content value" }, new() { Alias = "variantText", Value = "#1: The first content value in English", Culture = "en-US" }, new() { Alias = "variantText", Value = "#1: The first content value in Danish", Culture = "da-DK" } }, [], null, - null - ) + null) ) - ] - ); + ]); content.Properties["blocks"]!.SetValue(JsonSerializer.Serialize(blockListValue)); ContentService.Save(content); @@ -1021,31 +1019,30 @@ public async Task Can_Publish_With_Blocks_In_One_Language() firstBlockContentElementKey, firstBlockSettingsElementKey, new BlockProperty( - new List { + new List + { new() { Alias = "invariantText", Value = "#1: The second invariant content value" }, new() { Alias = "variantText", Value = "#1: The second content value in English", Culture = "en-US" }, new() { Alias = "variantText", Value = "#1: The second content value in Danish", Culture = "da-DK" } }, [], null, - null - ) + null) ), ( Guid.NewGuid(), Guid.NewGuid(), new BlockProperty( - new List { + new List + { new() { Alias = "invariantText", Value = "#2: The second invariant content value" }, new() { Alias = "variantText", Value = "#2: The second content value in English", Culture = "en-US" } }, [], null, - null - ) + null) ) - ] - ); + ]); content.Properties["blocks"]!.SetValue(JsonSerializer.Serialize(blockListValue)); @@ -1103,32 +1100,31 @@ public async Task Can_Publish_With_Blocks_Exposed() Guid.NewGuid(), Guid.NewGuid(), new BlockProperty( - new List { + new List + { new() { Alias = "invariantText", Value = "#1: The invariant content value" }, new() { Alias = "variantText", Value = "#1: The content value in English", Culture = "en-US" }, new() { Alias = "variantText", Value = "#1: The content value in Danish", Culture = "da-DK" } }, [], null, - null - ) + null) ), ( Guid.NewGuid(), Guid.NewGuid(), new BlockProperty( - new List { + new List + { new() { Alias = "invariantText", Value = "#2: The invariant content value" }, new() { Alias = "variantText", Value = "#2: The content value in English", Culture = "en-US" }, new() { Alias = "variantText", Value = "#2: The content value in Danish", Culture = "da-DK" } }, [], null, - null - ) + null) ) - ] - ); + ]); blockListValue.Expose = [ @@ -1205,30 +1201,29 @@ public async Task Can_Expose_Invariant_Blocks_Across_Cultures() Guid.NewGuid(), Guid.NewGuid(), new BlockProperty( - new List { + new List + { new() { Alias = "invariantText", Value = "#1: The invariant content value" }, new() { Alias = "variantText", Value = "#1: The other invariant content value" } }, [], null, - null - ) + null) ), ( Guid.NewGuid(), Guid.NewGuid(), new BlockProperty( - new List { + new List + { new() { Alias = "invariantText", Value = "#2: The invariant content value" }, new() { Alias = "variantText", Value = "#2: The other invariant content value" } }, [], null, - null - ) + null) ) - ] - ); + ]); blockListValue.Expose = [ @@ -1307,17 +1302,16 @@ public async Task Can_Expose_Both_Variant_And_Invariant_Blocks() Guid.NewGuid(), Guid.NewGuid(), new BlockProperty( - new List { + new List + { new() { Alias = "invariantText", Value = "#1: The invariant content value" }, new() { Alias = "variantText", Value = "#1: The other invariant content value" } }, [], null, - null - ) + null) ) - ] - ); + ]); var variantElementKey = Guid.NewGuid(); blockListValue.Layout[Constants.PropertyEditors.Aliases.BlockList] = blockListValue @@ -1331,8 +1325,7 @@ public async Task Can_Expose_Both_Variant_And_Invariant_Blocks() new() { Alias = "variantText", Value = "#2: The variant content value in English", Culture = "en-US" }, new() { Alias = "variantText", Value = "#2: The variant content value in Danish", Culture = "da-DK" }, ] - } - ); + }); blockListValue.Expose = [ @@ -1408,7 +1401,8 @@ public async Task Can_Publish_Invariant_Properties_Without_Default_Culture_With_ Guid.NewGuid(), Guid.NewGuid(), new BlockProperty( - new List { + new List + { new() { Alias = "invariantText", Value = "The first invariant content value" }, new() { Alias = "variantText", Value = "The first content value in English", Culture = "en-US" }, new() { Alias = "variantText", Value = "The first content value in Danish", Culture = "da-DK" } @@ -1420,11 +1414,9 @@ public async Task Can_Publish_Invariant_Properties_Without_Default_Culture_With_ new() { Alias = "variantText", Value = "The first settings value in Danish", Culture = "da-DK" }, }, null, - null - ) + null) ) - ] - ); + ]); blockListValue.Expose = [ @@ -1497,7 +1489,8 @@ public async Task Cannot_Publish_Invariant_Properties_Without_Default_Culture_Wi Guid.NewGuid(), Guid.NewGuid(), new BlockProperty( - new List { + new List + { new() { Alias = "invariantText", Value = "The first invariant content value" }, new() { Alias = "variantText", Value = "The first content value in English", Culture = "en-US" }, new() { Alias = "variantText", Value = "The first content value in Danish", Culture = "da-DK" } @@ -1509,11 +1502,9 @@ public async Task Cannot_Publish_Invariant_Properties_Without_Default_Culture_Wi new() { Alias = "variantText", Value = "The first settings value in Danish", Culture = "da-DK" }, }, null, - null - ) + null) ) - ] - ); + ]); blockListValue.Expose = [ diff --git a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheVariantsTests.cs b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheVariantsTests.cs index 87815fdbeb63..0094fbe526a8 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheVariantsTests.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.PublishedCache.HybridCache/DocumentHybridCacheVariantsTests.cs @@ -83,7 +83,7 @@ public async Task Can_Set_Invariant_Title() // Assert using var contextReference = UmbracoContextFactory.EnsureUmbracoContext(); - Assert.AreEqual(updatedInvariantTitle, textPage.Value(_invariantTitleAlias, "", "")); + Assert.AreEqual(updatedInvariantTitle, textPage.Value(_invariantTitleAlias, string.Empty, string.Empty)); Assert.AreEqual(updatedVariantTitle, textPage.Value(_variantTitleAlias, _englishIsoCode)); Assert.AreEqual(updatedVariantTitle, textPage.Value(_variantTitleAlias, _danishIsoCode)); } @@ -123,7 +123,7 @@ public async Task Can_Set_Invariant_Title_On_One_Culture() // Assert using var contextReference = UmbracoContextFactory.EnsureUmbracoContext(); - Assert.AreEqual(updatedInvariantTitle, textPage.Value(_invariantTitleAlias, "", "")); + Assert.AreEqual(updatedInvariantTitle, textPage.Value(_invariantTitleAlias, string.Empty, string.Empty)); Assert.AreEqual(updatedVariantTitle, textPage.Value(_variantTitleAlias, _englishIsoCode)); Assert.AreEqual(_variantTitleName, textPage.Value(_variantTitleAlias, _danishIsoCode)); } diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/RichTextPropertyEditorHelperTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/RichTextPropertyEditorHelperTests.cs index 72e2d77fa0ba..8d2d59337f16 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/RichTextPropertyEditorHelperTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/PropertyEditors/RichTextPropertyEditorHelperTests.cs @@ -258,7 +258,8 @@ public void Can_Parse_Mixed_Blocks_And_Inline_Blocks() Guid[] itemGuids = [Guid.Parse("36cc710a-d8a6-45d0-a07f-7bbd8742cf02"), Guid.Parse("36cc710a-d8a6-45d0-a07f-7bbd8742cf03")]; Assert.AreEqual(2, value.Blocks.ContentData.Count); - for (var i = 0; i < value.Blocks.ContentData.Count; i++) { + for (var i = 0; i < value.Blocks.ContentData.Count; i++) + { var item = value.Blocks.ContentData[i]; Assert.AreEqual(contentTypeGuids[i], item.ContentTypeKey); Assert.AreEqual(itemGuids[i], item.Key); diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentNavigationServiceBaseTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentNavigationServiceBaseTests.cs index 7d9a2e8397ff..276f8e3f6878 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentNavigationServiceBaseTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentNavigationServiceBaseTests.cs @@ -164,14 +164,8 @@ public void Can_Get_Children_From_Existing_Content_Key(Guid parentKey, int child } [Test] - [TestCase("E48DD82A-7059-418E-9B82-CDD5205796CF", - new[] - { - "C6173927-0C59-4778-825D-D7B9F45D8DDE", "60E0E5C4-084E-4144-A560-7393BEAD2E96", - "B606E3FF-E070-4D46-8CB9-D31352029FDF" - })] // Root - [TestCase("C6173927-0C59-4778-825D-D7B9F45D8DDE", - new[] { "E856AC03-C23E-4F63-9AA9-681B42A58573", "A1B1B217-B02F-4307-862C-A5E22DB729EB" })] // Child 1 + [TestCase("E48DD82A-7059-418E-9B82-CDD5205796CF", new[] { "C6173927-0C59-4778-825D-D7B9F45D8DDE", "60E0E5C4-084E-4144-A560-7393BEAD2E96", "B606E3FF-E070-4D46-8CB9-D31352029FDF" })] // Root + [TestCase("C6173927-0C59-4778-825D-D7B9F45D8DDE", new[] { "E856AC03-C23E-4F63-9AA9-681B42A58573", "A1B1B217-B02F-4307-862C-A5E22DB729EB" })] // Child 1 [TestCase("E856AC03-C23E-4F63-9AA9-681B42A58573", new string[0])] // Grandchild 1 [TestCase("60E0E5C4-084E-4144-A560-7393BEAD2E96", new[] { "D63C1621-C74A-4106-8587-817DEE5FB732" })] // Child 2 [TestCase("D63C1621-C74A-4106-8587-817DEE5FB732", new[] { "56E29EA9-E224-4210-A59F-7C2C5C0C5CC7" })] // Grandchild 3 @@ -211,8 +205,7 @@ public void Cannot_Get_Descendants_From_Non_Existing_Content_Key() } [Test] - [TestCase("E48DD82A-7059-418E-9B82-CDD5205796CF", - 8)] // Root - Child 1, Grandchild 1, Grandchild 2, Child 2, Grandchild 3, Great-grandchild 1, Child 3, Grandchild 4 + [TestCase("E48DD82A-7059-418E-9B82-CDD5205796CF", 8)] // Root - Child 1, Grandchild 1, Grandchild 2, Child 2, Grandchild 3, Great-grandchild 1, Child 3, Grandchild 4 [TestCase("C6173927-0C59-4778-825D-D7B9F45D8DDE", 2)] // Child 1 - Grandchild 1, Grandchild 2 [TestCase("E856AC03-C23E-4F63-9AA9-681B42A58573", 0)] // Grandchild 1 [TestCase("A1B1B217-B02F-4307-862C-A5E22DB729EB", 0)] // Grandchild 2 @@ -235,19 +228,10 @@ public void Can_Get_Descendants_From_Existing_Content_Key(Guid parentKey, int de } [Test] - [TestCase("E48DD82A-7059-418E-9B82-CDD5205796CF", - new[] - { - "C6173927-0C59-4778-825D-D7B9F45D8DDE", "E856AC03-C23E-4F63-9AA9-681B42A58573", - "A1B1B217-B02F-4307-862C-A5E22DB729EB", "60E0E5C4-084E-4144-A560-7393BEAD2E96", - "D63C1621-C74A-4106-8587-817DEE5FB732", "56E29EA9-E224-4210-A59F-7C2C5C0C5CC7", - "B606E3FF-E070-4D46-8CB9-D31352029FDF", "F381906C-223C-4466-80F7-B63B4EE073F8" - })] // Root - [TestCase("C6173927-0C59-4778-825D-D7B9F45D8DDE", - new[] { "E856AC03-C23E-4F63-9AA9-681B42A58573", "A1B1B217-B02F-4307-862C-A5E22DB729EB" })] // Child 1 + [TestCase("E48DD82A-7059-418E-9B82-CDD5205796CF", new[] { "C6173927-0C59-4778-825D-D7B9F45D8DDE", "E856AC03-C23E-4F63-9AA9-681B42A58573", "A1B1B217-B02F-4307-862C-A5E22DB729EB", "60E0E5C4-084E-4144-A560-7393BEAD2E96", "D63C1621-C74A-4106-8587-817DEE5FB732", "56E29EA9-E224-4210-A59F-7C2C5C0C5CC7", "B606E3FF-E070-4D46-8CB9-D31352029FDF", "F381906C-223C-4466-80F7-B63B4EE073F8" })] // Root + [TestCase("C6173927-0C59-4778-825D-D7B9F45D8DDE", new[] { "E856AC03-C23E-4F63-9AA9-681B42A58573", "A1B1B217-B02F-4307-862C-A5E22DB729EB" })] // Child 1 [TestCase("E856AC03-C23E-4F63-9AA9-681B42A58573", new string[0])] // Grandchild 1 - [TestCase("60E0E5C4-084E-4144-A560-7393BEAD2E96", - new[] { "D63C1621-C74A-4106-8587-817DEE5FB732", "56E29EA9-E224-4210-A59F-7C2C5C0C5CC7" })] // Child 2 + [TestCase("60E0E5C4-084E-4144-A560-7393BEAD2E96", new[] { "D63C1621-C74A-4106-8587-817DEE5FB732", "56E29EA9-E224-4210-A59F-7C2C5C0C5CC7" })] // Child 2 [TestCase("D63C1621-C74A-4106-8587-817DEE5FB732", new[] { "56E29EA9-E224-4210-A59F-7C2C5C0C5CC7" })] // Grandchild 3 [TestCase("56E29EA9-E224-4210-A59F-7C2C5C0C5CC7", new string[0])] // Great-grandchild 1 [TestCase("B606E3FF-E070-4D46-8CB9-D31352029FDF", new[] { "F381906C-223C-4466-80F7-B63B4EE073F8" })] // Child 3 @@ -310,14 +294,8 @@ public void Can_Get_Ancestors_From_Existing_Content_Key(Guid childKey, int ances [Test] [TestCase("E48DD82A-7059-418E-9B82-CDD5205796CF", new string[0])] // Root [TestCase("C6173927-0C59-4778-825D-D7B9F45D8DDE", new[] { "E48DD82A-7059-418E-9B82-CDD5205796CF" })] // Child 1 - [TestCase("E856AC03-C23E-4F63-9AA9-681B42A58573", - new[] { "C6173927-0C59-4778-825D-D7B9F45D8DDE", "E48DD82A-7059-418E-9B82-CDD5205796CF" })] // Grandchild 1 - [TestCase("56E29EA9-E224-4210-A59F-7C2C5C0C5CC7", - new[] - { - "D63C1621-C74A-4106-8587-817DEE5FB732", "60E0E5C4-084E-4144-A560-7393BEAD2E96", - "E48DD82A-7059-418E-9B82-CDD5205796CF" - })] // Great-grandchild 1 + [TestCase("E856AC03-C23E-4F63-9AA9-681B42A58573", new[] { "C6173927-0C59-4778-825D-D7B9F45D8DDE", "E48DD82A-7059-418E-9B82-CDD5205796CF" })] // Grandchild 1 + [TestCase("56E29EA9-E224-4210-A59F-7C2C5C0C5CC7", new[] { "D63C1621-C74A-4106-8587-817DEE5FB732", "60E0E5C4-084E-4144-A560-7393BEAD2E96", "E48DD82A-7059-418E-9B82-CDD5205796CF" })] // Great-grandchild 1 public void Can_Get_Ancestors_From_Existing_Content_Key_In_Correct_Order(Guid childKey, string[] ancestors) { // Arrange diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj index 02a84f6d74e6..fa70b2e48558 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj @@ -12,10 +12,10 @@ remove param, [SA1405] Debug.Assert message text, [ASP0019] header append, [CS0114] inherited member, [CS0661]/[CS0659], adjust overrides, [CS0414] unassigned field, [CS0252] confirm reference comparison, [IDE0060] remove parameter, [IDE1006] fix naming rule violation, - and remove overrides --> + [CS0612] obsolete, and remove overrides --> SYSLIB0013,CS0618,CS1998,SA1117,CS0067,CA1822,CA1416,IDE0028,SA1401,SA1405 - IDE0060,SA1405,ASP0019,CS0114,CS0661,CS0659,CS0414,CS0252,IDE0060,IDE1006 + IDE0060,SA1405,ASP0019,CS0114,CS0661,CS0659,CS0414,CS0252,CS0612,IDE0060,IDE1006