2024-12-02 11:07:01 -05:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
using BinaryObjectScanner.FileType;
|
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BinaryObjectScanner.Test.FileType
|
|
|
|
|
|
{
|
|
|
|
|
|
public class TextfileTests
|
|
|
|
|
|
{
|
|
|
|
|
|
[Fact]
|
2024-12-02 11:21:14 -05:00
|
|
|
|
public void DetectFile_EmptyString_Null()
|
2024-12-02 11:07:01 -05:00
|
|
|
|
{
|
|
|
|
|
|
string file = string.Empty;
|
|
|
|
|
|
var detectable = new Textfile();
|
|
|
|
|
|
|
|
|
|
|
|
string? actual = detectable.Detect(file, includeDebug: false);
|
|
|
|
|
|
Assert.Null(actual);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
2024-12-02 11:21:14 -05:00
|
|
|
|
public void DetectStream_EmptyStream_Null()
|
2024-12-02 11:07:01 -05:00
|
|
|
|
{
|
|
|
|
|
|
Stream? stream = new MemoryStream();
|
|
|
|
|
|
string file = string.Empty;
|
|
|
|
|
|
var detectable = new Textfile();
|
|
|
|
|
|
|
|
|
|
|
|
string? actual = detectable.Detect(stream, file, includeDebug: false);
|
|
|
|
|
|
Assert.Null(actual);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|