mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-02-04 13:45:28 +00:00
45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using System.IO;
|
|
using BinaryObjectScanner.Protection;
|
|
using Xunit;
|
|
|
|
namespace BinaryObjectScanner.Test.Protection
|
|
{
|
|
public class DiscGuardTests
|
|
{
|
|
[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 DiscGuard();
|
|
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
|
Assert.Null(actual);
|
|
}
|
|
|
|
[Fact]
|
|
public void CheckDirectoryPathTest()
|
|
{
|
|
string path = "path";
|
|
List<string> files = [];
|
|
|
|
var checker = new DiscGuard();
|
|
List<string> actual = checker.CheckDirectoryPath(path, files);
|
|
Assert.Empty(actual);
|
|
}
|
|
|
|
[Fact]
|
|
public void CheckFilePathTest()
|
|
{
|
|
string path = "path";
|
|
|
|
var checker = new DiscGuard();
|
|
string? actual = checker.CheckFilePath(path);
|
|
Assert.Null(actual);
|
|
}
|
|
}
|
|
}
|