Skip to content

Commit 0957559

Browse files
jbreuerlauraneto
andauthored
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 <[email protected]>
1 parent aaa44a2 commit 0957559

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

tests/Umbraco.Tests.Common/Builders/ContentTypeEditingBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public static ContentTypeCreateModel CreateContentTypeWithContentPicker(string a
192192
.Build();
193193
}
194194

195-
public static ContentTypeCreateModel CreateContentTypeWithTwoPropertiesOneVariantAndOneInvariant(string alias = "test", string name = "TestName", string variantPropertyAlias = "variant", string variantPropertyName = "Variant", string invariantAlias = "invariant", string invariantName = "Invariant")
195+
public static ContentTypeCreateModel CreateContentTypeWithTwoPropertiesOneVariantAndOneInvariant(string alias = "test", string name = "TestName", string variantPropertyAlias = "variant", string variantPropertyName = "Variant", string invariantAlias = "invariant", string invariantName = "Invariant")
196196
{
197197
var containerKey = Guid.NewGuid();
198198
var builder = new ContentTypeEditingBuilder();

tests/Umbraco.Tests.Common/TestHelperBase.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ public IScopeProvider ScopeProvider
9696
Mock.Of<IMediaPathScheme>(),
9797
loggerFactory.CreateLogger<MediaFileManager>(),
9898
Mock.Of<IShortStringHelper>(),
99-
Mock.Of<IServiceProvider>(),
100-
Options.Create(new ContentSettings()));
99+
Mock.Of<IServiceProvider>());
101100
var databaseFactory = new Mock<IUmbracoDatabaseFactory>();
102101
var database = new Mock<IUmbracoDatabase>();
103102
var sqlContext = new Mock<ISqlContext>();
@@ -207,7 +206,7 @@ public virtual string MapPathForTestFiles(string relativePath)
207206
throw new ArgumentException("relativePath must start with '~/'", nameof(relativePath));
208207
}
209208

210-
var codeBase = typeof(TestHelperBase).Assembly.CodeBase;
209+
var codeBase = typeof(TestHelperBase).Assembly.Location;
211210
var uri = new Uri(codeBase);
212211
var path = uri.LocalPath;
213212
var bin = Path.GetDirectoryName(path);

tests/Umbraco.Tests.Common/TestLastChanceFinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ namespace Umbraco.Cms.Tests.Common;
88

99
public class TestLastChanceFinder : IContentLastChanceFinder
1010
{
11-
public async Task<bool> TryFindContent(IPublishedRequestBuilder frequest) => false;
11+
public Task<bool> TryFindContent(IPublishedRequestBuilder frequest) => Task.FromResult(false);
1212
}

0 commit comments

Comments
 (0)