Add GetInfo tests

This commit is contained in:
Matt Nadareski
2025-01-06 10:51:50 -05:00
parent 593121c03a
commit 05616db0f4
4 changed files with 143 additions and 2 deletions

View File

@@ -43,8 +43,10 @@ namespace SabreTools.FileTypes
/// <returns>Populated BaseFile object if success, empty on error</returns>
public static BaseFile GetInfo(string input, HashType[] hashes, string? header)
{
// Add safeguard if file doesn't exist
if (!File.Exists(input))
// Add safeguard if file is invalid
if (string.IsNullOrEmpty(input))
return new BaseFile();
else if (!File.Exists(input))
return new BaseFile();
try