Files
2025-09-29 08:01:50 -04:00

35 lines
1003 B
C#

using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class MSDOSTests
{
private static readonly SabreTools.Serialization.Wrappers.MSDOS wrapper
= new(new SabreTools.Data.Models.MSDOS.Executable(), new MemoryStream(new byte[1024]));
[Fact]
public void DetectFile_EmptyString_Null()
{
string file = string.Empty;
var detectable = new MSDOS(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 MSDOS(wrapper);
string? actual = detectable.Detect(stream, file, includeDebug: false);
Assert.NotNull(actual);
Assert.Empty(actual);
}
}
}