Fixing tests to accomodate for interesting XML behavior.

This commit is contained in:
Harrison Deng 2020-02-29 17:20:56 -05:00
parent 72d080c04c
commit ec03e0d647

View File

@ -64,7 +64,23 @@ namespace RecrownedGTK.Test.Persistence {
public void SaveTestContent() {
preferences.SetPreference("val", 1);
preferences.Save();
FileAssert.AreEqual("assets/preferences.xml", string.Format("{0}/{1}.xml", PATH, FILENAME));
string[] expectedLines = File.ReadAllLines("assets/preferences.xml");
string expected = null;
for (int i = 0; i < expectedLines.Length; i++) {
if (i != 1) {
expected += expectedLines[i];
}
}
string[] actualLines = File.ReadAllLines(string.Format("{0}/{1}.xml", PATH, FILENAME));
string actual = null;
for (int i = 0; i < expectedLines.Length; i++) {
if (i != 1) {
actual += actualLines[i];
}
}
Assert.AreEqual(expected, actual);
}
[Test]