mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-02-10 21:30:24 +00:00
* Initial * Laserlock in * This is a better way to read the string * That array copy wasn't needed either * Use static filetype method, rename filetype.iso * Initial Codelok ISO scanning * Comments with redump IDs * Add redump examples to laserlock * Change for testing * Small comment * TAGES * halfway through safedisc * Safedisc done * Fix 1 * Major oversights in puredata fixed * Finish SecuROM * ProtectDiSC done * Alpharom done * Finish StarForce, initial PR review ready * Wait, that would be really bad * One more for the road. * Small finding * Small fix for finding * Notes on finding * Several minor fixes, decisions * what do you MEAN it returns true if there are no elements in the array * Future todo * Update packages * Rebase * Fix runisochecks * First round of fixes * Second round of fixes * Tests attempt 1 * Make checks work * Individual test attempt 1 * Final tests --------- Co-authored-by: Matt Nadareski <mnadareski@outlook.com>
57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
using BinaryObjectScanner.Protection;
|
|
using Xunit;
|
|
|
|
namespace BinaryObjectScanner.Test.Protection
|
|
{
|
|
public class TAGESTests
|
|
{
|
|
[Fact]
|
|
public void CheckPortableExecutableTest()
|
|
{
|
|
string file = "filename";
|
|
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
|
Stream source = new MemoryStream(new byte[1024]);
|
|
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
|
|
|
var checker = new TAGES();
|
|
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
|
Assert.Null(actual);
|
|
}
|
|
|
|
[Fact]
|
|
public void CheckDirectoryPathTest()
|
|
{
|
|
string path = "path";
|
|
List<string> files = [];
|
|
|
|
var checker = new TAGES();
|
|
List<string> actual = checker.CheckDirectoryPath(path, files);
|
|
Assert.Empty(actual);
|
|
}
|
|
|
|
[Fact]
|
|
public void CheckFilePathTest()
|
|
{
|
|
string path = "path";
|
|
|
|
var checker = new TAGES();
|
|
string? actual = checker.CheckFilePath(path);
|
|
Assert.Null(actual);
|
|
}
|
|
|
|
[Fact]
|
|
public void CheckDiskImageTest()
|
|
{
|
|
string file = "filename";
|
|
SabreTools.Data.Models.ISO9660.Volume model = new();
|
|
Stream source = new MemoryStream(new byte[1024]);
|
|
SabreTools.Serialization.Wrappers.ISO9660 iso = new(model, source);
|
|
|
|
var checker = new TAGES();
|
|
string? actual = checker.CheckDiskImage(file, iso, includeDebug: false);
|
|
Assert.Null(actual);
|
|
}
|
|
}
|
|
} |