Skip to content

Commit

Permalink
Add file type tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mnadareski committed Dec 2, 2024
1 parent 1a99767 commit dbd2175
Show file tree
Hide file tree
Showing 34 changed files with 1,377 additions and 2 deletions.
31 changes: 31 additions & 0 deletions BinaryObjectScanner.Test/FileType/AACSMediaKeyBlockTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;

namespace BinaryObjectScanner.Test.FileType
{
public class AACSMediaKeyBlockTests
{
[Fact]
public void DetectFileTest()
{
string file = string.Empty;
var detectable = new AACSMediaKeyBlock();

string? actual = detectable.Detect(file, includeDebug: false);
Assert.Null(actual);
}

[Fact]
public void DetectStream()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
var detectable = new AACSMediaKeyBlock();

string? actual = detectable.Detect(stream, file, includeDebug: false);
Assert.Null(actual);
}
}
}

31 changes: 31 additions & 0 deletions BinaryObjectScanner.Test/FileType/BDPlusSVMTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;

namespace BinaryObjectScanner.Test.FileType
{
public class BDPlusSVMTests
{
[Fact]
public void DetectFileTest()
{
string file = string.Empty;
var detectable = new BDPlusSVM();

string? actual = detectable.Detect(file, includeDebug: false);
Assert.Null(actual);
}

[Fact]
public void DetectStream()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
var detectable = new BDPlusSVM();

string? actual = detectable.Detect(stream, file, includeDebug: false);
Assert.Null(actual);
}
}
}

44 changes: 44 additions & 0 deletions BinaryObjectScanner.Test/FileType/BFPKTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;

namespace BinaryObjectScanner.Test.FileType
{
public class BFPKTests
{
[Fact]
public void ExtractFileTest()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new BFPK();

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 BFPK();

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 BFPK();

bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}
44 changes: 44 additions & 0 deletions BinaryObjectScanner.Test/FileType/BSPTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;

namespace BinaryObjectScanner.Test.FileType
{
public class BSPTests
{
[Fact]
public void ExtractFileTest()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new BSP();

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 BSP();

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 BSP();

bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}
44 changes: 44 additions & 0 deletions BinaryObjectScanner.Test/FileType/BZip2Tests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;

namespace BinaryObjectScanner.Test.FileType
{
public class BZip2Tests
{
[Fact]
public void ExtractFileTest()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new BZip2();

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 BZip2();

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 BZip2();

bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}
44 changes: 44 additions & 0 deletions BinaryObjectScanner.Test/FileType/CFBTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;

namespace BinaryObjectScanner.Test.FileType
{
public class CFBTests
{
[Fact]
public void ExtractFileTest()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new CFB();

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 CFB();

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 CFB();

bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}
31 changes: 31 additions & 0 deletions BinaryObjectScanner.Test/FileType/ExecutableTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;

namespace BinaryObjectScanner.Test.FileType
{
public class ExecutableTests
{
[Fact]
public void DetectFileTest()
{
string file = string.Empty;
var detectable = new Executable();

string? actual = detectable.Detect(file, includeDebug: false);
Assert.Null(actual);
}

[Fact]
public void DetectStream()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
var detectable = new Executable();

string? actual = detectable.Detect(stream, file, includeDebug: false);
Assert.Null(actual);
}
}
}

44 changes: 44 additions & 0 deletions BinaryObjectScanner.Test/FileType/GCFTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;

namespace BinaryObjectScanner.Test.FileType
{
public class GCFTests
{
[Fact]
public void ExtractFileTest()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new GCF();

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 GCF();

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 GCF();

bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}
44 changes: 44 additions & 0 deletions BinaryObjectScanner.Test/FileType/GZIPTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;

namespace BinaryObjectScanner.Test.FileType
{
public class GZIPTests
{
[Fact]
public void ExtractFileTest()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new GZIP();

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 GZIP();

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 GZIP();

bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}
Loading

0 comments on commit dbd2175

Please sign in to comment.