mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-02-10 05:40:03 +00:00
66 lines
1.8 KiB
C#
66 lines
1.8 KiB
C#
using System.IO;
|
|
using BinaryObjectScanner.FileType;
|
|
using Xunit;
|
|
|
|
namespace BinaryObjectScanner.Test.FileType
|
|
{
|
|
public class SFFSTests
|
|
{
|
|
[Fact]
|
|
public void DetectFile_EmptyString_Null()
|
|
{
|
|
string file = string.Empty;
|
|
var detectable = new SFFS();
|
|
|
|
string? actual = detectable.Detect(file, includeDebug: false);
|
|
Assert.Null(actual);
|
|
}
|
|
|
|
[Fact]
|
|
public void DetectStream_EmptyStream_Null()
|
|
{
|
|
Stream? stream = new MemoryStream();
|
|
string file = string.Empty;
|
|
var detectable = new SFFS();
|
|
|
|
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
|
Assert.Null(actual);
|
|
}
|
|
|
|
[Fact]
|
|
public void ExtractFile_EmptyString_False()
|
|
{
|
|
string file = string.Empty;
|
|
string outDir = string.Empty;
|
|
var extractable = new SFFS();
|
|
|
|
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
|
Assert.False(actual);
|
|
}
|
|
|
|
[Fact]
|
|
public void ExtractStream_Null_False()
|
|
{
|
|
Stream? stream = null;
|
|
string file = string.Empty;
|
|
string outDir = string.Empty;
|
|
var extractable = new SFFS();
|
|
|
|
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
|
Assert.False(actual);
|
|
}
|
|
|
|
[Fact]
|
|
public void ExtractStream_Empty_False()
|
|
{
|
|
Stream? stream = new MemoryStream();
|
|
string file = string.Empty;
|
|
string outDir = string.Empty;
|
|
var extractable = new SFFS();
|
|
|
|
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
|
Assert.False(actual);
|
|
}
|
|
}
|
|
}
|