2020-12-23 11:35:49 +01:00
|
|
|
// Copyright (c) Umbraco.
|
|
|
|
|
// See LICENSE for more details.
|
|
|
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
2020-08-24 12:34:37 +02:00
|
|
|
using Microsoft.Extensions.Options;
|
|
|
|
|
using Umbraco.Core.Configuration.Models;
|
2020-03-27 11:39:17 +01:00
|
|
|
using Umbraco.Web.Common.AspNetCore;
|
2020-04-14 16:55:54 +01:00
|
|
|
using IHostingEnvironment = Umbraco.Core.Hosting.IHostingEnvironment;
|
2020-03-25 15:06:22 +11:00
|
|
|
|
|
|
|
|
namespace Umbraco.Tests.Integration.Implementations
|
|
|
|
|
{
|
2020-04-14 16:55:54 +01:00
|
|
|
public class TestHostingEnvironment : AspNetCoreHostingEnvironment, IHostingEnvironment
|
2020-03-25 15:06:22 +11:00
|
|
|
{
|
2021-02-08 11:00:15 +01:00
|
|
|
public TestHostingEnvironment(IOptionsMonitor<HostingSettings> hostingSettings,IOptionsMonitor<WebRoutingSettings> webRoutingSettings, IWebHostEnvironment webHostEnvironment)
|
|
|
|
|
: base(hostingSettings,webRoutingSettings, webHostEnvironment)
|
2020-03-25 15:06:22 +11:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2020-12-23 11:35:49 +01:00
|
|
|
/// Gets a value indicating whether we are hosted.
|
2020-03-25 15:06:22 +11:00
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
2020-12-23 11:35:49 +01:00
|
|
|
/// 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.
|
2020-03-25 15:06:22 +11:00
|
|
|
/// </remarks>
|
2020-04-14 16:55:54 +01:00
|
|
|
bool IHostingEnvironment.IsHosted { get; } = false;
|
2020-03-25 15:06:22 +11:00
|
|
|
}
|
|
|
|
|
}
|