Add listrom deserialization test, fix issues

This commit is contained in:
Matt Nadareski
2023-07-13 17:52:25 -04:00
parent 025bea69a1
commit d55f35d3fc
7 changed files with 257 additions and 8 deletions

View File

@@ -98,7 +98,7 @@ namespace SabreTools.Test.Parser
[Theory]
[InlineData("test-sfv.sfv", Hash.CRC)]
[InlineData("test-md5.md5", Hash.MD5)]
[InlineData("test-sha1.sha1", Hash.SHA1)]
[InlineData("test-sha1.sha1", Hash.SHA1)]
[InlineData("test-sha256.sha256", Hash.SHA256)]
[InlineData("test-sha384.sha384", Hash.SHA384)]
[InlineData("test-sha512.sha512", Hash.SHA512)]
@@ -142,6 +142,23 @@ namespace SabreTools.Test.Parser
}
}
[Fact]
public void ListromDeserializeTest()
{
// Open the file for reading
string filename = System.IO.Path.Combine(Environment.CurrentDirectory, "TestData", "test-listrom-files.txt.gz");
// Deserialize the file
var dat = Serialization.Listrom.Deserialize(filename);
// Validate the values
Assert.NotNull(dat?.Set);
Assert.Equal(45861, dat.Set.Length);
// Validate we're not missing any attributes or elements
Assert.Empty(dat.ADDITIONAL_ELEMENTS);
}
[Fact]
public void ListxmlDeserializeTest()
{