From 09575599ad540e9678af3bbca0af6286ee82f9f6 Mon Sep 17 00:00:00 2001 From: Jeroen Breuer Date: Fri, 3 Jan 2025 17:59:50 +0100 Subject: [PATCH] Fix Umbraco.Tests.Common warnings. (#17172) * Fix async warning. * Fix MediaFileManager warning. * Fix TypeLoader warning. * Fix CodeBase warning. * Fix ContentTypeEditingBuilder warning. * Fix _containerKey warning. * Fix _key warning. * Fix issues due to merge with contrib --------- Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com> --- .../Builders/ContentTypeEditingBuilder.cs | 2 +- tests/Umbraco.Tests.Common/TestHelperBase.cs | 5 ++--- tests/Umbraco.Tests.Common/TestLastChanceFinder.cs | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/Umbraco.Tests.Common/Builders/ContentTypeEditingBuilder.cs b/tests/Umbraco.Tests.Common/Builders/ContentTypeEditingBuilder.cs index c9cdc41552..f34decd0c2 100644 --- a/tests/Umbraco.Tests.Common/Builders/ContentTypeEditingBuilder.cs +++ b/tests/Umbraco.Tests.Common/Builders/ContentTypeEditingBuilder.cs @@ -192,7 +192,7 @@ public class ContentTypeEditingBuilder : ContentTypeEditingBaseBuilder(), loggerFactory.CreateLogger(), Mock.Of(), - Mock.Of(), - Options.Create(new ContentSettings())); + Mock.Of()); var databaseFactory = new Mock(); var database = new Mock(); var sqlContext = new Mock(); @@ -207,7 +206,7 @@ public abstract class TestHelperBase throw new ArgumentException("relativePath must start with '~/'", nameof(relativePath)); } - var codeBase = typeof(TestHelperBase).Assembly.CodeBase; + var codeBase = typeof(TestHelperBase).Assembly.Location; var uri = new Uri(codeBase); var path = uri.LocalPath; var bin = Path.GetDirectoryName(path); diff --git a/tests/Umbraco.Tests.Common/TestLastChanceFinder.cs b/tests/Umbraco.Tests.Common/TestLastChanceFinder.cs index 3b00e20981..85c8f7b97f 100644 --- a/tests/Umbraco.Tests.Common/TestLastChanceFinder.cs +++ b/tests/Umbraco.Tests.Common/TestLastChanceFinder.cs @@ -8,5 +8,5 @@ namespace Umbraco.Cms.Tests.Common; public class TestLastChanceFinder : IContentLastChanceFinder { - public async Task TryFindContent(IPublishedRequestBuilder frequest) => false; + public Task TryFindContent(IPublishedRequestBuilder frequest) => Task.FromResult(false); }