mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add end-to-end DatStatistics tests
This commit is contained in:
@@ -335,6 +335,7 @@ namespace SabreTools.DatFiles
|
||||
/// <param name="file">Item to add info from</param>
|
||||
private void AddItemStatistics(DatItems.Formats.File file)
|
||||
{
|
||||
TotalSize += file.Size ?? 0;
|
||||
AddHashCount(HashType.CRC32, string.IsNullOrEmpty(file.CRC) ? 0 : 1);
|
||||
AddHashCount(HashType.MD5, string.IsNullOrEmpty(file.MD5) ? 0 : 1);
|
||||
AddHashCount(HashType.SHA1, string.IsNullOrEmpty(file.SHA1) ? 0 : 1);
|
||||
@@ -457,6 +458,7 @@ namespace SabreTools.DatFiles
|
||||
/// <param name="file">Item to remove info for</param>
|
||||
private void RemoveItemStatistics(DatItems.Formats.File file)
|
||||
{
|
||||
TotalSize -= file.Size ?? 0;
|
||||
RemoveHashCount(HashType.CRC32, string.IsNullOrEmpty(file.CRC) ? 0 : 1);
|
||||
RemoveHashCount(HashType.MD5, string.IsNullOrEmpty(file.MD5) ? 0 : 1);
|
||||
RemoveHashCount(HashType.SHA1, string.IsNullOrEmpty(file.SHA1) ? 0 : 1);
|
||||
|
||||
Reference in New Issue
Block a user