aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Mock
diff options
context:
space:
mode:
Diffstat (limited to 'Timeline.Tests/Mock')
-rw-r--r--Timeline.Tests/Mock/Services/MockStringLocalizer.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/Timeline.Tests/Mock/Services/MockStringLocalizer.cs b/Timeline.Tests/Mock/Services/MockStringLocalizer.cs
new file mode 100644
index 00000000..7729d56c
--- /dev/null
+++ b/Timeline.Tests/Mock/Services/MockStringLocalizer.cs
@@ -0,0 +1,31 @@
+using Microsoft.Extensions.Localization;
+using System.Collections.Generic;
+using System.Globalization;
+
+namespace Timeline.Tests.Mock.Services
+{
+ public class MockStringLocalizer : IStringLocalizer
+ {
+ private const string mockKey = "MOCK_KEY";
+ private const string mockString = "THIS IS A MOCK LOCALIZED STRING.";
+
+ public LocalizedString this[string name] => new LocalizedString(name, mockString);
+
+ public LocalizedString this[string name, params object[] arguments] => new LocalizedString(name, mockString);
+
+ public IEnumerable<LocalizedString> GetAllStrings(bool includeParentCultures)
+ {
+ yield return new LocalizedString(mockKey, mockString);
+ }
+
+ public IStringLocalizer WithCulture(CultureInfo culture)
+ {
+ return this;
+ }
+ }
+
+ public class MockStringLocalizer<T> : MockStringLocalizer, IStringLocalizer<T>
+ {
+
+ }
+}