diff --git a/src/HUDAnimations.Tests/HUDAnimationsSerializerTests.cs b/src/HUDAnimations.Tests/HUDAnimationsSerializerTests.cs index 3b7f6df..b6cf99b 100644 --- a/src/HUDAnimations.Tests/HUDAnimationsSerializerTests.cs +++ b/src/HUDAnimations.Tests/HUDAnimationsSerializerTests.cs @@ -14,7 +14,20 @@ public void DeserializeTest() { foreach (string path in Directory.EnumerateFiles("HUDAnimationsSerializerTests/scripts")) { - HUDAnimationsSerializer.Deserialize(File.ReadAllText(path)); + string text = File.ReadAllText(path); + + HUDAnimationsSerializer.Deserialize(text); + + CultureInfo currentCulture = CultureInfo.CurrentCulture; + + foreach (CultureInfo culture in CultureInfo.GetCultures(CultureTypes.AllCultures)) + { + CultureInfo.CurrentCulture = culture; + + HUDAnimationsSerializer.Deserialize(text); + } + + CultureInfo.CurrentCulture = currentCulture; } } @@ -29,7 +42,10 @@ public void SerializeTest() foreach (CultureInfo culture in CultureInfo.GetCultures(CultureTypes.AllCultures)) { CultureInfo.CurrentCulture = culture; - Assert.AreEqual(text, HUDAnimationsSerializer.Serialize(animations)); + + string result = HUDAnimationsSerializer.Serialize(animations); + Assert.AreEqual(text, result, CultureInfo.CurrentCulture.Name); + HUDAnimationsSerializer.Deserialize(result); } CultureInfo.CurrentCulture = currentCulture; diff --git a/src/HUDAnimations/HUDAnimationsSerializer.cs b/src/HUDAnimations/HUDAnimationsSerializer.cs index f153e7b..83d0a33 100644 --- a/src/HUDAnimations/HUDAnimationsSerializer.cs +++ b/src/HUDAnimations/HUDAnimationsSerializer.cs @@ -181,7 +181,7 @@ bool ReadBool() : null; } - return command.ToLower() switch + return command.ToLowerInvariant() switch { "animate" => new Animate {