diff --git a/src/StardewModdingAPI.Tests/TranslationTests.cs b/src/StardewModdingAPI.Tests/TranslationTests.cs index 09f0ce32..a2fef2b7 100644 --- a/src/StardewModdingAPI.Tests/TranslationTests.cs +++ b/src/StardewModdingAPI.Tests/TranslationTests.cs @@ -16,19 +16,6 @@ namespace StardewModdingAPI.Tests /// Sample translation text for unit tests. public static string[] Samples = { null, "", " ", "boop", " boop " }; - /// A token structure type. - public enum TokenType - { - /// The tokens are passed in a string/object dictionary. - DictionaryStringObject, - - /// The tokens are passed in a string/string dictionary. - DictionaryStringString, - - /// The tokens are passed in an anonymous object. - AnonymousObject - } - /********* ** Unit tests @@ -193,7 +180,7 @@ namespace StardewModdingAPI.Tests ** Translation tokens ****/ [Test(Description = "Assert that multiple translation tokens are replaced correctly regardless of the token structure.")] - public void Translation_Tokens([Values(TokenType.AnonymousObject, TokenType.DictionaryStringObject, TokenType.DictionaryStringString)] TokenType tokenType) + public void Translation_Tokens([Values("anonymous object", "IDictionary", "IDictionary")] string structure) { // arrange string start = Guid.NewGuid().ToString("N"); @@ -204,22 +191,22 @@ namespace StardewModdingAPI.Tests // act Translation translation = new Translation("ModName", "pt-BR", "key", input); - switch (tokenType) + switch (structure) { - case TokenType.AnonymousObject: + case "anonymous object": translation = translation.Tokens(new { start, middle, end }); break; - case TokenType.DictionaryStringObject: + case "IDictionary": translation = translation.Tokens(new Dictionary { ["start"] = start, ["middle"] = middle, ["end"] = end }); break; - case TokenType.DictionaryStringString: + case "IDictionary": translation = translation.Tokens(new Dictionary { ["start"] = start, ["middle"] = middle, ["end"] = end }); break; default: - throw new NotSupportedException($"Unknown token type {tokenType}."); + throw new NotSupportedException($"Unknown structure '{structure}'."); } // assert