Skip to content

Commit

Permalink
Try transitioning into class...
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Sep 8, 2024
1 parent 1e65724 commit c666d43
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions GangsTest/TestLocale/LocaleFileKVData.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
using Microsoft.Extensions.Localization;
using System.Collections;
using Microsoft.Extensions.Localization;

namespace GangsTest.TestLocale;

public class LocaleFileKVData : TheoryData<string, string> {
public LocaleFileKVData() {
foreach (var localizedString in StringLocalizer.Instance.GetAllStrings())
Add(localizedString.Name, localizedString.Value);
public class LocaleFileKVData : IEnumerable<object[]> {
public IEnumerator<object[]> GetEnumerator() {
return StringLocalizer.Instance.GetAllStrings(true)
.Select(keyValuePair => (object[]) [keyValuePair.Name, keyValuePair.Value])
.GetEnumerator();
}

IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); }
}

0 comments on commit c666d43

Please sign in to comment.