diff --git a/src/Microsoft.Extensions.Localization/ResourceManagerStringLocalizer.cs b/src/Microsoft.Extensions.Localization/ResourceManagerStringLocalizer.cs index cccd45f..128c1c1 100644 --- a/src/Microsoft.Extensions.Localization/ResourceManagerStringLocalizer.cs +++ b/src/Microsoft.Extensions.Localization/ResourceManagerStringLocalizer.cs @@ -36,19 +36,28 @@ namespace Microsoft.Extensions.Localization Assembly resourceAssembly, string baseName, IResourceNamesCache resourceNamesCache) + : this( + resourceManager, + new AssemblyWrapper(resourceAssembly), + baseName, + resourceNamesCache) + { + } + + /// + /// Intended for testing purposes only. + /// + public ResourceManagerStringLocalizer( + ResourceManager resourceManager, + AssemblyWrapper resourceAssemblyWrapper, + string baseName, + IResourceNamesCache resourceNamesCache) : this( resourceManager, - new AssemblyResourceStringProvider( - resourceNamesCache, - new AssemblyWrapper(resourceAssembly), - baseName), + new AssemblyResourceStringProvider(resourceNamesCache, resourceAssemblyWrapper, baseName), baseName, resourceNamesCache) { - if (resourceAssembly == null) - { - throw new ArgumentNullException(nameof(resourceAssembly)); - } } ///