2026-03-17 14:30:34 -04:00
|
|
|
using System.IO;
|
|
|
|
|
using BinaryObjectScanner.FileType;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace BinaryObjectScanner.Test.FileType
|
|
|
|
|
{
|
|
|
|
|
public class GCFTests
|
|
|
|
|
{
|
2026-06-12 11:00:13 -04:00
|
|
|
private static readonly SabreTools.Wrappers.GCF wrapper
|
2026-03-17 14:30:34 -04:00
|
|
|
= new(new SabreTools.Data.Models.GCF.File(), new MemoryStream(new byte[1024]));
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void DetectFile_EmptyString_Null()
|
|
|
|
|
{
|
|
|
|
|
string file = string.Empty;
|
|
|
|
|
var detectable = new GCF(wrapper);
|
|
|
|
|
|
|
|
|
|
string? actual = detectable.Detect(file, includeDebug: false);
|
|
|
|
|
Assert.Null(actual);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void DetectStream_EmptyStream_DefaultValue()
|
|
|
|
|
{
|
|
|
|
|
Stream? stream = new MemoryStream();
|
|
|
|
|
string file = string.Empty;
|
|
|
|
|
var detectable = new GCF(wrapper);
|
|
|
|
|
|
|
|
|
|
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
2026-03-17 14:36:49 -04:00
|
|
|
Assert.Equal(" - 0 (v0)", actual);
|
2026-03-17 14:30:34 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|