From 48c4c235d2043784cff0af001f8a3af75588a0e8 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 3 Mar 2021 15:36:10 +1100 Subject: [PATCH] fixing tests, updating nunit --- .../Umbraco.Tests.Common.csproj | 2 +- .../Umbraco.Tests.Integration.csproj | 4 +- .../Umbraco.Tests.UnitTests.csproj | 66 +++++++++---------- src/Umbraco.Tests/Umbraco.Tests.csproj | 8 +-- .../UmbracoContext/UmbracoContext.cs | 4 +- 5 files changed, 41 insertions(+), 43 deletions(-) diff --git a/src/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj b/src/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj index b02c1a5a29..ffa9cd45ce 100644 --- a/src/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj +++ b/src/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj b/src/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj index 18cc68996d..93d2c739f0 100644 --- a/src/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj +++ b/src/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj @@ -1,4 +1,4 @@ - + Exe @@ -61,7 +61,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj b/src/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj index bcb4022ec7..b62beef0eb 100644 --- a/src/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj +++ b/src/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj @@ -1,41 +1,41 @@ - + - - Exe - net5.0 - false - Umbraco.Cms.Tests.UnitTests - + + Exe + net5.0 + false + Umbraco.Cms.Tests.UnitTests + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + - - - + + + - - - + + + diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj index 930db50828..0cb145b7c6 100644 --- a/src/Umbraco.Tests/Umbraco.Tests.csproj +++ b/src/Umbraco.Tests/Umbraco.Tests.csproj @@ -1,4 +1,4 @@ - + @@ -114,14 +114,12 @@ - + - - @@ -326,4 +324,4 @@ - \ No newline at end of file + diff --git a/src/Umbraco.Web.Common/UmbracoContext/UmbracoContext.cs b/src/Umbraco.Web.Common/UmbracoContext/UmbracoContext.cs index c31fe4dd3e..877f13d97a 100644 --- a/src/Umbraco.Web.Common/UmbracoContext/UmbracoContext.cs +++ b/src/Umbraco.Web.Common/UmbracoContext/UmbracoContext.cs @@ -54,7 +54,7 @@ namespace Umbraco.Cms.Web.Common.UmbracoContext ObjectCreated = DateTime.Now; UmbracoRequestId = Guid.NewGuid(); - _backofficeSecurity = backofficeSecurity ?? throw new ArgumentNullException(nameof(backofficeSecurity)); + _backofficeSecurity = backofficeSecurity; _umbracoRequestPaths = umbracoRequestPaths; // beware - we cannot expect a current user here, so detecting preview mode must be a lazy thing @@ -143,7 +143,7 @@ namespace Umbraco.Cms.Web.Common.UmbracoContext Uri requestUrl = _requestAccessor.GetRequestUrl(); if (requestUrl != null && _umbracoRequestPaths.IsBackOfficeRequest(requestUrl.AbsolutePath) == false - && _backofficeSecurity.CurrentUser != null) + && _backofficeSecurity?.CurrentUser != null) { var previewToken = _cookieManager.GetCookieValue(Core.Constants.Web.PreviewCookieName); // may be null or empty _previewToken = previewToken.IsNullOrWhiteSpace() ? null : previewToken;