Files
Umbraco-CMS/src/Umbraco.Tests.Integration/Implementations/TestHostingEnvironment.cs

29 lines
1.1 KiB
C#
Raw Normal View History

// Copyright (c) Umbraco.
// See LICENSE for more details.
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Options;
using Umbraco.Core.Configuration.Models;
using Umbraco.Web.Common.AspNetCore;
using IHostingEnvironment = Umbraco.Core.Hosting.IHostingEnvironment;
namespace Umbraco.Tests.Integration.Implementations
{
public class TestHostingEnvironment : AspNetCoreHostingEnvironment, IHostingEnvironment
{
public TestHostingEnvironment(IOptionsMonitor<HostingSettings> hostingSettings,IOptionsMonitor<WebRoutingSettings> webRoutingSettings, IWebHostEnvironment webHostEnvironment)
: base(hostingSettings,webRoutingSettings, webHostEnvironment)
{
}
/// <summary>
/// Gets a value indicating whether we are hosted.
/// </summary>
/// <remarks>
/// This is specifically used by IOHelper and we want this to return false so that the root path is manually
/// calculated which is what we want for tests.
/// </remarks>
bool IHostingEnvironment.IsHosted { get; } = false;
}
}