Merge remote-tracking branch 'origin/rel/2.0.0-preview1' into dev

This commit is contained in:
Ryan Brandenburg 2017-04-26 12:54:45 -07:00
commit c7b1924f79
3 changed files with 5 additions and 20 deletions

View File

@ -23,7 +23,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
return testRunner.RunTestAndVerifyResponseHeading( return testRunner.RunTestAndVerifyResponseHeading(
RuntimeFlavor.Clr, RuntimeFlavor.Clr,
RuntimeArchitecture.x64, RuntimeArchitecture.x64,
"http://localhost:5080",
"My/Resources", "My/Resources",
"fr-FR", "fr-FR",
"<h1>Bonjour</h1>"); "<h1>Bonjour</h1>");
@ -37,7 +36,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
return testRunner.RunTestAndVerifyResponseHeading( return testRunner.RunTestAndVerifyResponseHeading(
RuntimeFlavor.CoreClr, RuntimeFlavor.CoreClr,
RuntimeArchitecture.x64, RuntimeArchitecture.x64,
"http://localhost:5081/",
"My/Resources", "My/Resources",
"fr-FR", "fr-FR",
"<h1>Bonjour</h1>"); "<h1>Bonjour</h1>");

View File

@ -21,7 +21,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
return testRunner.RunTestAndVerifyResponse( return testRunner.RunTestAndVerifyResponse(
RuntimeFlavor.CoreClr, RuntimeFlavor.CoreClr,
RuntimeArchitecture.x64, RuntimeArchitecture.x64,
"http://localhost:5070",
"CustomCulturePreserved", "CustomCulturePreserved",
"en-US", "en-US",
"kr10.00"); "kr10.00");
@ -37,7 +36,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
return testRunner.RunTestAndVerifyResponse( return testRunner.RunTestAndVerifyResponse(
RuntimeFlavor.Clr, RuntimeFlavor.Clr,
RuntimeArchitecture.x64, RuntimeArchitecture.x64,
"http://localhost:5071",
"CustomCulturePreserved", "CustomCulturePreserved",
"en-US", "en-US",
"kr10.00"); "kr10.00");
@ -51,7 +49,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
return testRunner.RunTestAndVerifyResponse( return testRunner.RunTestAndVerifyResponse(
RuntimeFlavor.CoreClr, RuntimeFlavor.CoreClr,
RuntimeArchitecture.x64, RuntimeArchitecture.x64,
"http://localhost:5072",
"ResourcesInClassLibrary", "ResourcesInClassLibrary",
"fr-FR", "fr-FR",
"Bonjour from ResourcesClassLibraryNoAttribute Bonjour from ResourcesClassLibraryNoAttribute Bonjour from ResourcesClassLibraryWithAttribute Bonjour from ResourcesClassLibraryWithAttribute"); "Bonjour from ResourcesClassLibraryNoAttribute Bonjour from ResourcesClassLibraryNoAttribute Bonjour from ResourcesClassLibraryWithAttribute Bonjour from ResourcesClassLibraryWithAttribute");
@ -67,7 +64,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
return testRunner.RunTestAndVerifyResponse( return testRunner.RunTestAndVerifyResponse(
RuntimeFlavor.Clr, RuntimeFlavor.Clr,
RuntimeArchitecture.x64, RuntimeArchitecture.x64,
"http://localhost:5073",
"ResourcesInClassLibrary", "ResourcesInClassLibrary",
"fr-FR", "fr-FR",
"Bonjour from ResourcesClassLibraryNoAttribute Bonjour from ResourcesClassLibraryNoAttribute Bonjour from ResourcesClassLibraryWithAttribute Bonjour from ResourcesClassLibraryWithAttribute"); "Bonjour from ResourcesClassLibraryNoAttribute Bonjour from ResourcesClassLibraryNoAttribute Bonjour from ResourcesClassLibraryWithAttribute Bonjour from ResourcesClassLibraryWithAttribute");
@ -81,7 +77,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
return testRunner.RunTestAndVerifyResponse( return testRunner.RunTestAndVerifyResponse(
RuntimeFlavor.CoreClr, RuntimeFlavor.CoreClr,
RuntimeArchitecture.x64, RuntimeArchitecture.x64,
"http://localhost:5074",
"ResourcesInFolder", "ResourcesInFolder",
"fr-FR", "fr-FR",
"Bonjour from StartupResourcesInFolder Bonjour from Test in resources folder Bonjour from Customer in resources folder Hello"); "Bonjour from StartupResourcesInFolder Bonjour from Test in resources folder Bonjour from Customer in resources folder Hello");
@ -97,7 +92,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
return testRunner.RunTestAndVerifyResponse( return testRunner.RunTestAndVerifyResponse(
RuntimeFlavor.Clr, RuntimeFlavor.Clr,
RuntimeArchitecture.x64, RuntimeArchitecture.x64,
"http://localhost:5075/",
"ResourcesInFolder", "ResourcesInFolder",
"fr-FR", "fr-FR",
"Bonjour from StartupResourcesInFolder Bonjour from Test in resources folder Bonjour from Customer in resources folder Hello"); "Bonjour from StartupResourcesInFolder Bonjour from Test in resources folder Bonjour from Customer in resources folder Hello");
@ -111,7 +105,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
return testRunner.RunTestAndVerifyResponse( return testRunner.RunTestAndVerifyResponse(
RuntimeFlavor.CoreClr, RuntimeFlavor.CoreClr,
RuntimeArchitecture.x64, RuntimeArchitecture.x64,
"http://localhost:5076",
"ResourcesInFolder", "ResourcesInFolder",
"fr-FR-test", "fr-FR-test",
"Bonjour from StartupResourcesInFolder Bonjour from Test in resources folder Bonjour from Customer in resources folder Hello"); "Bonjour from StartupResourcesInFolder Bonjour from Test in resources folder Bonjour from Customer in resources folder Hello");
@ -127,7 +120,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
return testRunner.RunTestAndVerifyResponse( return testRunner.RunTestAndVerifyResponse(
RuntimeFlavor.Clr, RuntimeFlavor.Clr,
RuntimeArchitecture.x64, RuntimeArchitecture.x64,
"http://localhost:5077",
"ResourcesInFolder", "ResourcesInFolder",
"fr-FR-test", "fr-FR-test",
"Bonjour from StartupResourcesInFolder Bonjour from Test in resources folder Bonjour from Customer in resources folder Hello"); "Bonjour from StartupResourcesInFolder Bonjour from Test in resources folder Bonjour from Customer in resources folder Hello");
@ -141,7 +133,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
return testRunner.RunTestAndVerifyResponse( return testRunner.RunTestAndVerifyResponse(
RuntimeFlavor.CoreClr, RuntimeFlavor.CoreClr,
RuntimeArchitecture.x64, RuntimeArchitecture.x64,
"http://localhost:5078/",
"ResourcesInFolder", "ResourcesInFolder",
"fr-FR-test-again-too-deep-to-work", "fr-FR-test-again-too-deep-to-work",
"Hello Hello Hello Hello"); "Hello Hello Hello Hello");
@ -157,7 +148,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
return testRunner.RunTestAndVerifyResponse( return testRunner.RunTestAndVerifyResponse(
RuntimeFlavor.Clr, RuntimeFlavor.Clr,
RuntimeArchitecture.x64, RuntimeArchitecture.x64,
"http://localhost:5079/",
"ResourcesInFolder", "ResourcesInFolder",
"fr-FR-test-again-too-deep-to-work", "fr-FR-test-again-too-deep-to-work",
"Hello Hello Hello Hello"); "Hello Hello Hello Hello");
@ -171,7 +161,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
return testRunner.RunTestAndVerifyResponse( return testRunner.RunTestAndVerifyResponse(
RuntimeFlavor.CoreClr, RuntimeFlavor.CoreClr,
RuntimeArchitecture.x64, RuntimeArchitecture.x64,
"http://localhost:5070",
"ResourcesAtRootFolder", "ResourcesAtRootFolder",
"fr-FR", "fr-FR",
"Bonjour from StartupResourcesAtRootFolder Bonjour from Test in root folder Bonjour from Customer in Models folder"); "Bonjour from StartupResourcesAtRootFolder Bonjour from Test in root folder Bonjour from Customer in Models folder");
@ -187,7 +176,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
return testRunner.RunTestAndVerifyResponse( return testRunner.RunTestAndVerifyResponse(
RuntimeFlavor.Clr, RuntimeFlavor.Clr,
RuntimeArchitecture.x64, RuntimeArchitecture.x64,
"http://localhost:5071",
"ResourcesAtRootFolder", "ResourcesAtRootFolder",
"fr-FR", "fr-FR",
"Bonjour from StartupResourcesAtRootFolder Bonjour from Test in root folder Bonjour from Customer in Models folder"); "Bonjour from StartupResourcesAtRootFolder Bonjour from Test in root folder Bonjour from Customer in Models folder");

View File

@ -14,6 +14,8 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
{ {
public class TestRunner public class TestRunner
{ {
private const string ApplicationBasePath = "http://localhost:0";
private string _applicationPath; private string _applicationPath;
public TestRunner(string applicationPath) public TestRunner(string applicationPath)
@ -44,7 +46,6 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
private async Task<string> RunTestAndGetResponse( private async Task<string> RunTestAndGetResponse(
RuntimeFlavor runtimeFlavor, RuntimeFlavor runtimeFlavor,
RuntimeArchitecture runtimeArchitecture, RuntimeArchitecture runtimeArchitecture,
string applicationBaseUrl,
string environmentName, string environmentName,
string locale) string locale)
{ {
@ -52,7 +53,7 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
var deploymentParameters = new DeploymentParameters(_applicationPath, ServerType.Kestrel, runtimeFlavor, runtimeArchitecture) var deploymentParameters = new DeploymentParameters(_applicationPath, ServerType.Kestrel, runtimeFlavor, runtimeArchitecture)
{ {
ApplicationBaseUriHint = applicationBaseUrl, ApplicationBaseUriHint = ApplicationBasePath,
EnvironmentName = environmentName, EnvironmentName = environmentName,
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net46" : "netcoreapp2.0" TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net46" : "netcoreapp2.0"
}; };
@ -86,12 +87,11 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
public async Task RunTestAndVerifyResponse( public async Task RunTestAndVerifyResponse(
RuntimeFlavor runtimeFlavor, RuntimeFlavor runtimeFlavor,
RuntimeArchitecture runtimeArchitecture, RuntimeArchitecture runtimeArchitecture,
string applicationBaseUrl,
string environmentName, string environmentName,
string locale, string locale,
string expectedText) string expectedText)
{ {
var responseText = await RunTestAndGetResponse(runtimeFlavor, runtimeArchitecture, applicationBaseUrl, environmentName, locale); var responseText = await RunTestAndGetResponse(runtimeFlavor, runtimeArchitecture, environmentName, locale);
Console.WriteLine("Response Text " + responseText); Console.WriteLine("Response Text " + responseText);
Assert.Equal(expectedText, responseText); Assert.Equal(expectedText, responseText);
} }
@ -99,12 +99,11 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
public async Task RunTestAndVerifyResponseHeading( public async Task RunTestAndVerifyResponseHeading(
RuntimeFlavor runtimeFlavor, RuntimeFlavor runtimeFlavor,
RuntimeArchitecture runtimeArchitecture, RuntimeArchitecture runtimeArchitecture,
string applicationBaseUrl,
string environmentName, string environmentName,
string locale, string locale,
string expectedHeadingText) string expectedHeadingText)
{ {
var responseText = await RunTestAndGetResponse(runtimeFlavor, runtimeArchitecture, applicationBaseUrl, environmentName, locale); var responseText = await RunTestAndGetResponse(runtimeFlavor, runtimeArchitecture, environmentName, locale);
var headingIndex = responseText.IndexOf(expectedHeadingText); var headingIndex = responseText.IndexOf(expectedHeadingText);
Console.WriteLine("Response Header " + responseText); Console.WriteLine("Response Header " + responseText);
Assert.True(headingIndex >= 0); Assert.True(headingIndex >= 0);