Skip to content

Commit

Permalink
Add HUD Animations Serialize Culture test
Browse files Browse the repository at this point in the history
  • Loading branch information
cooolbros committed Jun 4, 2024
1 parent bb57658 commit 597f644
Show file tree
Hide file tree
Showing 4 changed files with 2,395 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/HUDAnimationsTests/HUDAnimationsSerializerTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.IO;
using System.Globalization;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using HUDAnimations.Models;

namespace HUDAnimations.Tests;

[TestClass()]
public class HUDAnimationsSerializerTests
{
[TestMethod()]
public void SerializeTest()
{
HUDAnimationsFile animations = HUDAnimationsSerializer.Deserialize(File.ReadAllText("HUDAnimationsSerializerTests/scripts/hudanimations_tf.txt"));
string text = HUDAnimationsSerializer.Serialize(animations);

CultureInfo currentCulture = CultureInfo.CurrentCulture;

foreach (CultureInfo culture in CultureInfo.GetCultures(CultureTypes.AllCultures))
{
CultureInfo.CurrentCulture = culture;
Assert.AreEqual(text, HUDAnimationsSerializer.Serialize(animations));
}

CultureInfo.CurrentCulture = currentCulture;
}
}
Loading

0 comments on commit 597f644

Please sign in to comment.