-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add HUD Animations Serialize Culture test
- Loading branch information
Showing
4 changed files
with
2,395 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.