mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add DosCenter deserialization test, fix issues
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user