2020-03-25 15:06:22 +11:00
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
{
2020-09-03 12:29:23 +02:00
public TestHostingEnvironment ( IOptionsMonitor < HostingSettings > hostingSettings , IWebHostEnvironment webHostEnvironment )
: base ( hostingSettings , webHostEnvironment )
2020-03-25 15:06:22 +11:00
{
}
/// <summary>
/// Override for tests since we are not hosted
/// </summary>
/// <remarks>
/// This is specifically used by IOHelper and we want this to return false so that the root path is manually calcualted which is what we want for tests.
/// </remarks>
2020-04-14 16:55:54 +01:00
bool IHostingEnvironment . IsHosted { get ; } = false ;
2020-03-25 15:06:22 +11:00
}
}