Files
Umbraco-CMS/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configuration/Models/GlobalSettingsTests.cs
Sven Geusens e7eb14d310 V15/task/cleanup obsolete (#17433)
* Replace obsolete UserGroup Alias consts to key equivalent in tests

* Update use of usergroup alias consts to key equivalent in IsSystemgroup extension method

* Obsolete (internally) unused helper function which purpose doesn't even seem true

* Prepped EmbedProviders for proper removal of non async methods and unneeded proxy methods

* Remove obsoleted UmbracoPath and updated internal references

* Corrected  mistake and updated unittets

* Update usergroup tests that use aliases for "system" groups

* Replace more uses of globalsettings.UmbracoPath

* Remove GetDateType by key non async

* Cleanup some usages of hostingEnvironment.MapPathContentRoot

* More easy obsoletion cleanup

* Small Typeload cleanup

* More obsolete removal

* Deploy obsoletion cleanup

* Remove obsolete methods from OEmbedProviderBase.cs

---------

Co-authored-by: Zeegaan <skrivdetud@gmail.com>
2024-11-07 12:20:22 +01:00

36 lines
1.2 KiB
C#

// Copyright (c) Umbraco.
// See LICENSE for more details.
using AutoFixture.NUnit3;
using Microsoft.Extensions.Options;
using NUnit.Framework;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Tests.UnitTests.AutoFixture;
using Umbraco.Cms.Web.Common.AspNetCore;
using Umbraco.Extensions;
namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Configuration.Models;
[TestFixture]
public class GlobalSettingsTests
{
[InlineAutoMoqData("~/umbraco", "/", "umbraco")]
[InlineAutoMoqData("~/umbraco", "/MyVirtualDir", "umbraco")]
[InlineAutoMoqData("~/customPath", "/MyVirtualDir/", "umbraco")]
[InlineAutoMoqData("~/some-wacky/nestedPath", "/MyVirtualDir", "umbraco")]
[InlineAutoMoqData("~/some-wacky/nestedPath", "/MyVirtualDir/NestedVDir/", "umbraco")]
public void Umbraco_Mvc_Area(
string path,
string rootPath,
string outcome,
[Frozen] IOptionsMonitor<HostingSettings> hostingSettings,
AspNetCoreHostingEnvironment hostingEnvironment)
{
hostingSettings.CurrentValue.ApplicationVirtualPath = rootPath;
var globalSettings = new GlobalSettings();
Assert.AreEqual(outcome, globalSettings.GetUmbracoMvcAreaNoCache(hostingEnvironment));
}
}