mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Parser tests, part 2
This commit is contained in:
@@ -13,33 +13,33 @@ namespace SabreTools.Test.DatTools
|
||||
// TODO: Ensure that all stress all bits of reading
|
||||
// TODO: Add total count? Might be a good metric if everything read
|
||||
[Theory]
|
||||
[InlineData(null, (DatFormat)0x00)]
|
||||
//[InlineData(null, DatFormat.Logiqx)]
|
||||
//[InlineData(null, DatFormat.LogiqxDeprecated)] // Not parsed separately
|
||||
//[InlineData(null, DatFormat.SoftwareList)]
|
||||
//[InlineData(null, DatFormat.Listxml)]
|
||||
//[InlineData(null, DatFormat.OfflineList)]
|
||||
//[InlineData(null, DatFormat.SabreXML)]
|
||||
//[InlineData(null, DatFormat.OpenMSX)]
|
||||
//[InlineData(null, DatFormat.ClrMamePro)]
|
||||
//[InlineData(null, DatFormat.RomCenter)]
|
||||
//[InlineData(null, DatFormat.DOSCenter)]
|
||||
//[InlineData(null, DatFormat.AttractMode)]
|
||||
//[InlineData(null, DatFormat.MissFile)] // Parsing is not supported
|
||||
//[InlineData(null, DatFormat.CSV)]
|
||||
//[InlineData(null, DatFormat.SSV)]
|
||||
//[InlineData(null, DatFormat.TSV)]
|
||||
//[InlineData(null, DatFormat.Listrom)]
|
||||
[InlineData("test-smdb.txt", DatFormat.EverdriveSMDB)]
|
||||
//[InlineData(null, DatFormat.SabreJSON)]
|
||||
[InlineData("test-sfv.sfv", DatFormat.RedumpSFV)]
|
||||
[InlineData("test-md5.md5", DatFormat.RedumpMD5)]
|
||||
[InlineData("test-sha1.sha1", DatFormat.RedumpSHA1)]
|
||||
[InlineData("test-sha256.sha256", DatFormat.RedumpSHA256)]
|
||||
[InlineData("test-sha384.sha384", DatFormat.RedumpSHA384)]
|
||||
[InlineData("test-sha512.sha512", DatFormat.RedumpSHA512)]
|
||||
[InlineData("test-spamsum.spamsum", DatFormat.RedumpSpamSum)]
|
||||
public void CreateAndParseTest(string filename, DatFormat datFormat)
|
||||
[InlineData(null, (DatFormat)0x00, 0)]
|
||||
//[InlineData(null, DatFormat.Logiqx, 0)]
|
||||
//[InlineData(null, DatFormat.LogiqxDeprecated, 0)] // Not parsed separately
|
||||
//[InlineData(null, DatFormat.SoftwareList, 0)]
|
||||
//[InlineData(null, DatFormat.Listxml, 0)]
|
||||
//[InlineData(null, DatFormat.OfflineList, 0)]
|
||||
//[InlineData(null, DatFormat.SabreXML, 0)]
|
||||
[InlineData("test-openmsx.xml", DatFormat.OpenMSX, 3)]
|
||||
[InlineData("test-cmp.dat", DatFormat.ClrMamePro, 6)]
|
||||
//[InlineData(null, DatFormat.RomCenter, 0)]
|
||||
//[InlineData(null, DatFormat.DOSCenter, 0)]
|
||||
[InlineData("test-attractmode.txt", DatFormat.AttractMode, 1)]
|
||||
//[InlineData(null, DatFormat.MissFile, 0)] // Parsing is not supported
|
||||
//[InlineData(null, DatFormat.CSV, 0)]
|
||||
//[InlineData(null, DatFormat.SSV, 0)]
|
||||
//[InlineData(null, DatFormat.TSV, 0)]
|
||||
[InlineData("test-listrom.txt", DatFormat.Listrom, 6)]
|
||||
[InlineData("test-smdb.txt", DatFormat.EverdriveSMDB, 1)]
|
||||
//[InlineData(null, DatFormat.SabreJSON, 0)]
|
||||
[InlineData("test-sfv.sfv", DatFormat.RedumpSFV, 1)]
|
||||
[InlineData("test-md5.md5", DatFormat.RedumpMD5, 1)]
|
||||
[InlineData("test-sha1.sha1", DatFormat.RedumpSHA1, 1)]
|
||||
[InlineData("test-sha256.sha256", DatFormat.RedumpSHA256, 1)]
|
||||
[InlineData("test-sha384.sha384", DatFormat.RedumpSHA384, 1)]
|
||||
[InlineData("test-sha512.sha512", DatFormat.RedumpSHA512, 1)]
|
||||
[InlineData("test-spamsum.spamsum", DatFormat.RedumpSpamSum, 1)]
|
||||
public void CreateAndParseTest(string filename, DatFormat datFormat, int totalCount)
|
||||
{
|
||||
// For all filenames, add the local path for test data
|
||||
if (filename != null)
|
||||
@@ -47,6 +47,7 @@ namespace SabreTools.Test.DatTools
|
||||
|
||||
var datFile = Parser.CreateAndParse(filename);
|
||||
Assert.Equal(datFormat, datFile.Header.DatFormat);
|
||||
Assert.Equal(totalCount, datFile.Items.TotalCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user