JasperFx / alba

Easy integration testing for ASP.NET Core applications
https://jasperfx.github.io/alba
Apache License 2.0
407 stars 39 forks source link

Relative content root being overwritten #65

Closed josephwoodward closed 4 years ago

josephwoodward commented 5 years ago

I'm currently configuring the TestServer by using the IWebHostBuilder delegate like so:

_client = SystemUnderTest.ForStartup<Startup>(x =>
{
    x.UseEnvironment("Development");
    x.UseSolutionRelativeContentRoot("src/Website");
    return x;
}).Server.CreateClient();

I want to set /src/Website as the ContentRoot (as opposed to the bin directory), however I'm noticing that the ContentRoot is then being overwritten by AppContext.BaseDirectory within here

It strikes me that the .useContentRoot(...) call on the aforementioned line should only occur if the content root hasn't already been set by the invocation of the builder delegate above it.