mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-02-04 05:35:49 +00:00
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using System.IO;
|
|
using BinaryObjectScanner.FileType;
|
|
using Xunit;
|
|
|
|
namespace BinaryObjectScanner.Test.FileType
|
|
{
|
|
public class NewExecutableTests
|
|
{
|
|
private static readonly SabreTools.Serialization.Wrappers.NewExecutable wrapper
|
|
= new(new SabreTools.Data.Models.NewExecutable.Executable(), new MemoryStream(new byte[1024]));
|
|
|
|
[Fact]
|
|
public void DetectFile_EmptyString_Null()
|
|
{
|
|
string file = string.Empty;
|
|
var detectable = new NewExecutable(wrapper);
|
|
|
|
string? actual = detectable.Detect(file, includeDebug: false);
|
|
Assert.Null(actual);
|
|
}
|
|
|
|
[Fact]
|
|
public void DetectStream_EmptyStream_Empty()
|
|
{
|
|
Stream? stream = new MemoryStream();
|
|
string file = string.Empty;
|
|
var detectable = new NewExecutable(wrapper);
|
|
|
|
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
|
Assert.NotNull(actual);
|
|
Assert.Empty(actual);
|
|
}
|
|
}
|
|
}
|