aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Mock/Services/TestStringLocalizerFactory.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-10-21 13:41:46 +0800
committer杨宇千 <crupest@outlook.com>2019-10-21 13:41:46 +0800
commitea8dd31e88aaf13af1f51e764623d6a7c73fb429 (patch)
tree705580fda162d3a2667f288ddb8092e8fba09703 /Timeline.Tests/Mock/Services/TestStringLocalizerFactory.cs
parent1ce632ad3c093bd60e4c75dd4229266604012729 (diff)
downloadtimeline-ea8dd31e88aaf13af1f51e764623d6a7c73fb429.tar.gz
timeline-ea8dd31e88aaf13af1f51e764623d6a7c73fb429.tar.bz2
timeline-ea8dd31e88aaf13af1f51e764623d6a7c73fb429.zip
...
Diffstat (limited to 'Timeline.Tests/Mock/Services/TestStringLocalizerFactory.cs')
-rw-r--r--Timeline.Tests/Mock/Services/TestStringLocalizerFactory.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/Timeline.Tests/Mock/Services/TestStringLocalizerFactory.cs b/Timeline.Tests/Mock/Services/TestStringLocalizerFactory.cs
new file mode 100644
index 00000000..4084dd8f
--- /dev/null
+++ b/Timeline.Tests/Mock/Services/TestStringLocalizerFactory.cs
@@ -0,0 +1,25 @@
+using Microsoft.Extensions.Localization;
+using Microsoft.Extensions.Logging.Abstractions;
+using Microsoft.Extensions.Options;
+
+namespace Timeline.Tests.Mock.Services
+{
+ internal static class TestStringLocalizerFactory
+ {
+ internal static IStringLocalizerFactory Create()
+ {
+ return new ResourceManagerStringLocalizerFactory(
+ Options.Create(new LocalizationOptions()
+ {
+ ResourcesPath = "Resource"
+ }),
+ NullLoggerFactory.Instance
+ );
+ }
+
+ internal static IStringLocalizer<T> Create<T>(this IStringLocalizerFactory factory)
+ {
+ return new StringLocalizer<T>(factory);
+ }
+ }
+}