mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-02-04 13:45:28 +00:00
80 lines
2.4 KiB
C#
80 lines
2.4 KiB
C#
using System.IO;
|
|
using BinaryObjectScanner.FileType;
|
|
using Xunit;
|
|
|
|
namespace BinaryObjectScanner.Test.FileType
|
|
{
|
|
public class RARTests
|
|
{
|
|
[Fact]
|
|
public void ExtractFile_EmptyString_False()
|
|
{
|
|
string file = string.Empty;
|
|
string outDir = string.Empty;
|
|
var extractable = new RAR();
|
|
|
|
bool actual = extractable.Extract(file, outDir, includeDebug: false);
|
|
Assert.False(actual);
|
|
}
|
|
|
|
[Fact]
|
|
public void ExtractFile_LookForHeader_EmptyString_False()
|
|
{
|
|
string file = string.Empty;
|
|
string outDir = string.Empty;
|
|
var extractable = new RAR();
|
|
|
|
bool actual = extractable.Extract(file, outDir, lookForHeader: true, 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 RAR();
|
|
|
|
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
|
Assert.False(actual);
|
|
}
|
|
|
|
[Fact]
|
|
public void ExtractStream_LookForHeader_Null_False()
|
|
{
|
|
Stream? stream = null;
|
|
string file = string.Empty;
|
|
string outDir = string.Empty;
|
|
var extractable = new RAR();
|
|
|
|
bool actual = extractable.Extract(stream, file, outDir, lookForHeader: true, 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 RAR();
|
|
|
|
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
|
|
Assert.False(actual);
|
|
}
|
|
|
|
[Fact]
|
|
public void ExtractStream_LookForHeader_Empty_False()
|
|
{
|
|
Stream? stream = new MemoryStream();
|
|
string file = string.Empty;
|
|
string outDir = string.Empty;
|
|
var extractable = new RAR();
|
|
|
|
bool actual = extractable.Extract(stream, file, outDir, lookForHeader: true, includeDebug: false);
|
|
Assert.False(actual);
|
|
}
|
|
}
|
|
}
|