diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/ApplicationConsumingPrecompiledViews.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/ApplicationConsumingPrecompiledViews.cs index 5f28a88d91..cd589745cc 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/ApplicationConsumingPrecompiledViews.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/ApplicationConsumingPrecompiledViews.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net.Http; using System.Runtime.InteropServices; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting; @@ -40,13 +39,11 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Precompilation using (var deployer = Fixture.CreateDeployment(flavor)) { var deploymentResult = deployer.Deploy(); - var httpClient = new HttpClient() - { - BaseAddress = new Uri(deploymentResult.ApplicationBaseUri) - }; // Act - var response = await httpClient.GetStringWithRetryAsync("Manage/Home", Fixture.Logger); + var response = await Fixture.HttpClient.GetStringWithRetryAsync( + deploymentResult.ApplicationBaseUri + "Manage/Home", + Fixture.Logger); // Assert TestEmbeddedResource.AssertContent("ApplicationConsumingPrecompiledViews.Manage.Home.Index.txt", response); diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/ApplicationWithConfigureMvcTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/ApplicationWithConfigureMvcTest.cs index 5378c97dd6..4265905f6a 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/ApplicationWithConfigureMvcTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/ApplicationWithConfigureMvcTest.cs @@ -1,10 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Collections.Generic; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting; using Xunit; @@ -37,13 +35,11 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Precompilation using (var deployer = Fixture.CreateDeployment(flavor)) { var deploymentResult = deployer.Deploy(); - var httpClient = new HttpClient() - { - BaseAddress = new Uri(deploymentResult.ApplicationBaseUri) - }; // Act - var response = await httpClient.GetStringWithRetryAsync("", Fixture.Logger); + var response = await Fixture.HttpClient.GetStringWithRetryAsync( + deploymentResult.ApplicationBaseUri, + Fixture.Logger); // Assert TestEmbeddedResource.AssertContent("ApplicationWithConfigureMvc.Home.Index.txt", response); @@ -58,13 +54,11 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Precompilation using (var deployer = Fixture.CreateDeployment(flavor)) { var deploymentResult = deployer.Deploy(); - var httpClient = new HttpClient() - { - BaseAddress = new Uri(deploymentResult.ApplicationBaseUri) - }; // Act - var response = await httpClient.GetStringWithRetryAsync("Home/ViewWithPreprocessor", Fixture.Logger); + var response = await Fixture.HttpClient.GetStringWithRetryAsync( + deploymentResult.ApplicationBaseUri + "Home/ViewWithPreprocessor", + Fixture.Logger); // Assert TestEmbeddedResource.AssertContent( diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/ApplicationWithTagHelpersTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/ApplicationWithTagHelpersTest.cs index dcb6219a8e..d515c00d45 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/ApplicationWithTagHelpersTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/ApplicationWithTagHelpersTest.cs @@ -1,11 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting; using Xunit; @@ -44,13 +42,11 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Precompilation using (var deployer = Fixture.CreateDeployment(flavor)) { var deploymentResult = deployer.Deploy(); - var httpClient = new HttpClient() - { - BaseAddress = new Uri(deploymentResult.ApplicationBaseUri) - }; // Act - var response = await httpClient.GetStringWithRetryAsync($"Home/{url}", Fixture.Logger); + var response = await Fixture.HttpClient.GetStringWithRetryAsync( + $"{deploymentResult.ApplicationBaseUri}Home/{url}", + Fixture.Logger); // Assert TestEmbeddedResource.AssertContent($"ApplicationWithTagHelpers.Home.{url}.txt", response); diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/SimpleAppTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/SimpleAppTest.cs index d0a89b9bf7..f6b97c2ce3 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/SimpleAppTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Precompilation.FunctionalTests/SimpleAppTest.cs @@ -1,10 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using System.Collections.Generic; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting; using Xunit; @@ -36,13 +34,11 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Precompilation using (var deployer = Fixture.CreateDeployment(flavor)) { var deploymentResult = deployer.Deploy(); - var httpClient = new HttpClient() - { - BaseAddress = new Uri(deploymentResult.ApplicationBaseUri) - }; // Act - var response = await httpClient.GetStringWithRetryAsync("", Fixture.Logger); + var response = await Fixture.HttpClient.GetStringWithRetryAsync( + deploymentResult.ApplicationBaseUri, + Fixture.Logger); // Assert TestEmbeddedResource.AssertContent("SimpleAppTest.Home.Index.txt", response);