2024-12-02 10:38:36 -05:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using BinaryObjectScanner.Protection;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace BinaryObjectScanner.Test.Protection
|
|
|
|
|
{
|
|
|
|
|
public class CopyXTests
|
|
|
|
|
{
|
|
|
|
|
[Fact]
|
|
|
|
|
public void CheckPortableExecutableTest()
|
|
|
|
|
{
|
|
|
|
|
string file = "filename";
|
2025-09-29 08:01:50 -04:00
|
|
|
SabreTools.Data.Models.PortableExecutable.Executable model = new();
|
2025-09-20 11:05:56 -04:00
|
|
|
Stream source = new MemoryStream(new byte[1024]);
|
2025-09-07 11:15:26 -04:00
|
|
|
SabreTools.Serialization.Wrappers.PortableExecutable exe = new(model, source);
|
2024-12-02 10:38:36 -05:00
|
|
|
|
|
|
|
|
var checker = new CopyX();
|
2025-09-07 11:15:26 -04:00
|
|
|
string? actual = checker.CheckExecutable(file, exe, includeDebug: false);
|
2024-12-02 10:38:36 -05:00
|
|
|
Assert.Null(actual);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void CheckDirectoryPathTest()
|
|
|
|
|
{
|
|
|
|
|
string path = "path";
|
|
|
|
|
List<string> files = [];
|
|
|
|
|
|
|
|
|
|
var checker = new CopyX();
|
|
|
|
|
List<string> actual = checker.CheckDirectoryPath(path, files);
|
|
|
|
|
Assert.Empty(actual);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void CheckFilePathTest()
|
|
|
|
|
{
|
|
|
|
|
string path = "path";
|
|
|
|
|
|
|
|
|
|
var checker = new CopyX();
|
|
|
|
|
string? actual = checker.CheckFilePath(path);
|
|
|
|
|
Assert.Null(actual);
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-11-07 08:24:22 -05:00
|
|
|
}
|