Fix StringLocalizer location null tests (#321)

This commit is contained in:
Ryan Brandenburg 2017-02-03 11:52:19 -08:00 committed by GitHub
parent 94b1875b28
commit 3ba495f32e
3 changed files with 8 additions and 12 deletions

View File

@ -42,7 +42,7 @@ namespace LocalizationWebsite
} }
}); });
var stringLocalizer = stringLocalizerFactory.Create("Test", location: null); var stringLocalizer = stringLocalizerFactory.Create("Test", location: typeof(LocalizationWebsite.StartupResourcesAtRootFolder).Assembly.GetName().Name);
app.Run(async (context) => app.Run(async (context) =>
{ {

View File

@ -43,10 +43,8 @@ namespace LocalizationWebsite
} }
}); });
var stringLocalizer = stringLocalizerFactory.Create("Test", location: null); var assemblyName = typeof(StartupResourcesInFolder).Assembly.GetName().Name;
var assembly = typeof(StartupResourcesInFolder).GetTypeInfo().Assembly; var stringLocalizer = stringLocalizerFactory.Create("Test", assemblyName);
var assemblyName = new AssemblyName(assembly.FullName).Name;
var stringLocalizerExplicitLocation = stringLocalizerFactory.Create("Test", assemblyName);
app.Run(async (context) => app.Run(async (context) =>
{ {
@ -55,8 +53,6 @@ namespace LocalizationWebsite
await context.Response.WriteAsync(stringLocalizer["Hello"]); await context.Response.WriteAsync(stringLocalizer["Hello"]);
await context.Response.WriteAsync(" "); await context.Response.WriteAsync(" ");
await context.Response.WriteAsync(custromerStringLocalizer["Hello"]); await context.Response.WriteAsync(custromerStringLocalizer["Hello"]);
await context.Response.WriteAsync(" ");
await context.Response.WriteAsync(stringLocalizerExplicitLocation["Hello"]);
}); });
} }
} }

View File

@ -100,7 +100,7 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
"http://localhost:5075/", "http://localhost:5075/",
"ResourcesInFolder", "ResourcesInFolder",
"fr-FR", "fr-FR",
"Bonjour from StartupResourcesInFolder Bonjour from Test in resources folder Bonjour from Customer in resources folder Bonjour from Test in resources folder"); "Bonjour from StartupResourcesInFolder Bonjour from Test in resources folder Bonjour from Customer in resources folder");
} }
[Fact(Skip = "https://github.com/aspnet/Localization/issues/310")] [Fact(Skip = "https://github.com/aspnet/Localization/issues/310")]
@ -114,7 +114,7 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
"http://localhost:5076", "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 Bonjour from Test in resources folder"); "Bonjour from StartupResourcesInFolder Bonjour from Test in resources folder Bonjour from Customer in resources folder");
} }
[ConditionalFact] [ConditionalFact]
@ -130,7 +130,7 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
"http://localhost:5077", "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 Bonjour from Test in resources folder"); "Bonjour from StartupResourcesInFolder Bonjour from Test in resources folder Bonjour from Customer in resources folder");
} }
[Fact(Skip = "https://github.com/aspnet/Localization/issues/310")] [Fact(Skip = "https://github.com/aspnet/Localization/issues/310")]
@ -144,7 +144,7 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
"http://localhost:5078/", "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");
} }
[ConditionalFact] [ConditionalFact]
@ -160,7 +160,7 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
"http://localhost:5079/", "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");
} }
[Fact(Skip = "https://github.com/aspnet/Localization/issues/310")] [Fact(Skip = "https://github.com/aspnet/Localization/issues/310")]