mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-04-21 05:33:31 +00:00
Add GCF tests
This commit is contained in:
33
BinaryObjectScanner.Test/FileType/GCFTests.cs
Normal file
33
BinaryObjectScanner.Test/FileType/GCFTests.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.IO;
|
||||
using BinaryObjectScanner.FileType;
|
||||
using Xunit;
|
||||
|
||||
namespace BinaryObjectScanner.Test.FileType
|
||||
{
|
||||
public class GCFTests
|
||||
{
|
||||
private static readonly SabreTools.Serialization.Wrappers.GCF wrapper
|
||||
= 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);
|
||||
Assert.Equal("AACS (Unknown Version)", actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user