Add DosCenter deserialization test, fix issues

This commit is contained in:
Matt Nadareski
2023-07-13 15:32:00 -04:00
parent 11b635e06a
commit 3ac1e7ce4e
9 changed files with 277 additions and 5 deletions

View File

@@ -48,6 +48,32 @@ namespace SabreTools.Test.Parser
}
}
[Fact]
public void DosCenterDeserializeTest()
{
// Open the file for reading
string filename = System.IO.Path.Combine(Environment.CurrentDirectory, "TestData", "test-doscenter-files.dat.gz");
// Deserialize the file
var dat = Serialization.DosCenter.Deserialize(filename);
// Validate the values
Assert.NotNull(dat?.DosCenter);
Assert.Equal(34965, dat.Game.Length);
// Validate we're not missing any attributes or elements
Assert.Empty(dat.ADDITIONAL_ELEMENTS);
Assert.Empty(dat.DosCenter.ADDITIONAL_ELEMENTS);
foreach (var game in dat.Game)
{
Assert.Empty(game.ADDITIONAL_ELEMENTS);
foreach (var file in game.File)
{
Assert.Empty(file.ADDITIONAL_ELEMENTS);
}
}
}
[Fact]
public void ListxmlDeserializeTest()
{