Start rearranging things

This commit is contained in:
Matt Nadareski
2025-09-06 09:53:34 -04:00
parent e9c1e9b7e7
commit 43b3c72a02
16 changed files with 527 additions and 133 deletions

View File

@@ -15,7 +15,7 @@ namespace BinaryObjectScanner.Test
WrapperType.AACSMediaKeyBlock,
WrapperType.BDPlusSVM,
//WrapperType.CIA,
WrapperType.Executable,
//WrapperType.Executable,
WrapperType.LDSCRYPT,
//WrapperType.N3DS,
//WrapperType.Nitro,
@@ -63,7 +63,7 @@ namespace BinaryObjectScanner.Test
WrapperType.BZip2,
WrapperType.CFB,
//WrapperType.CIA,
WrapperType.Executable,
//WrapperType.Executable,
WrapperType.GCF,
WrapperType.GZip,
WrapperType.InstallShieldArchiveV3,

View File

@@ -0,0 +1,30 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class LinearExecutableTests
{
[Fact]
public void DetectFile_EmptyString_Null()
{
string file = string.Empty;
var detectable = new LinearExecutable();
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 LinearExecutable();
string? actual = detectable.Detect(stream, file, includeDebug: false);
Assert.Null(actual);
}
}
}

View File

@@ -4,13 +4,13 @@ using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class ExecutableTests
public class MSDOSTests
{
[Fact]
public void DetectFile_EmptyString_Null()
{
string file = string.Empty;
var detectable = new Executable();
var detectable = new MSDOS();
string? actual = detectable.Detect(file, includeDebug: false);
Assert.Null(actual);
@@ -21,7 +21,7 @@ namespace BinaryObjectScanner.Test.FileType
{
Stream? stream = new MemoryStream();
string file = string.Empty;
var detectable = new Executable();
var detectable = new MSDOS();
string? actual = detectable.Detect(stream, file, includeDebug: false);
Assert.Null(actual);

View File

@@ -0,0 +1,30 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class NewExecutableTests
{
[Fact]
public void DetectFile_EmptyString_Null()
{
string file = string.Empty;
var detectable = new NewExecutable();
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 NewExecutable();
string? actual = detectable.Detect(stream, file, includeDebug: false);
Assert.Null(actual);
}
}
}

View File

@@ -0,0 +1,30 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class PortableExecutableTests
{
[Fact]
public void DetectFile_EmptyString_Null()
{
string file = string.Empty;
var detectable = new PortableExecutable();
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 PortableExecutable();
string? actual = detectable.Detect(stream, file, includeDebug: false);
Assert.Null(actual);
}
}
}