Fix relative content root path test for non-windows systems
This commit is contained in:
parent
bb3809d3dc
commit
b7bdc9c404
|
|
@ -333,8 +333,15 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
[Fact]
|
[Fact]
|
||||||
public void RelativeContentRootIsResolved()
|
public void RelativeContentRootIsResolved()
|
||||||
{
|
{
|
||||||
|
var contentRootNet451 = PlatformServices.Default.Runtime.OperatingSystemPlatform == Platform.Windows ?
|
||||||
|
"testroot" : "../../../../test/Microsoft.AspNetCore.Hosting.Tests/testroot";
|
||||||
|
|
||||||
var host = new WebHostBuilder()
|
var host = new WebHostBuilder()
|
||||||
|
#if NET451
|
||||||
|
.UseContentRoot(contentRootNet451)
|
||||||
|
#else
|
||||||
.UseContentRoot("testroot")
|
.UseContentRoot("testroot")
|
||||||
|
#endif
|
||||||
.UseServer(new TestServer())
|
.UseServer(new TestServer())
|
||||||
.UseStartup("Microsoft.AspNetCore.Hosting.Tests")
|
.UseStartup("Microsoft.AspNetCore.Hosting.Tests")
|
||||||
.Build();
|
.Build();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue