public async Task ChangeAppPath() { // [Setup] // setup webhost using appsettings with specific path var random = new Bogus.Randomizer(); var randomPathChars = random.Chars('a', 'z', random.Int(1, 10)); var randomPath = new string(randomPathChars); var randomSecret = random.Words(10); var hostbuilder = WebHost .CreateDefaultBuilder() .ConfigureServices(s => { s .AddOurOrders(appSettings => { appSettings.Path = randomPath; appSettings.JwtSecret = randomSecret; }) .UseInMemoryDB(); }) .Configure(appbuilder => { appbuilder .UseOurOrders(); }); var server = new TestServer(hostbuilder); var httpClient = server.CreateClient(); // [Exercise] // send a request to the webhost on the specified path var path = $"/{randomPath}/account/current"; var response = await httpClient.GetAsync(path); // [Verify] // check if request is successful Assert.True(response.IsSuccessStatusCode); // [Teardown] // shut down the server that we setup server.Dispose(); }