Use extractable wrappers where appropriate

This commit is contained in:
Matt Nadareski
2025-09-06 11:56:46 -04:00
parent e87a0ff8ec
commit 6361398b1b
68 changed files with 8 additions and 2119 deletions

View File

@@ -53,72 +53,5 @@ namespace BinaryObjectScanner.Test
}
#endregion
#region CreateExtractable
private static readonly List<WrapperType> _extractableTypes =
[
// WrapperType.BFPK, // TODO: Create wrapper to reenable test
// WrapperType.BSP, // TODO: Create wrapper to reenable test
// WrapperType.BZip2, // TODO: Create wrapper to reenable test
// WrapperType.CFB, // TODO: Create wrapper to reenable test
// WrapperType.CIA,
// WrapperType.Executable, // TODO: This needs to be split internally
// WrapperType.GCF, // TODO: Create wrapper to reenable test
// WrapperType.GZip, // TODO: Create wrapper to reenable test
// WrapperType.InstallShieldArchiveV3, // TODO: Create wrapper to reenable test
// WrapperType.InstallShieldCAB, // TODO: Create wrapper to reenable test
// WrapperType.LZKWAJ, // TODO: Create wrapper to reenable test
// WrapperType.LZQBasic, // TODO: Create wrapper to reenable test
// WrapperType.LZSZDD, // TODO: Create wrapper to reenable test
// WrapperType.MicrosoftCAB, // TODO: Create wrapper to reenable test
// WrapperType.MoPaQ, // TODO: Create wrapper to reenable test
// WrapperType.N3DS,
// WrapperType.NCF,
// WrapperType.Nitro,
// WrapperType.PAK, // TODO: Create wrapper to reenable test
// WrapperType.PFF, // TODO: Create wrapper to reenable test
// WrapperType.PKZIP, // TODO: Create wrapper to reenable test
// WrapperType.PlayJAudioFile, // TODO: Create wrapper to reenable test
// WrapperType.Quantum, // TODO: Create wrapper to reenable test
// WrapperType.RAR, // TODO: Create wrapper to reenable test
// WrapperType.SevenZip, // TODO: Create wrapper to reenable test
WrapperType.SFFS,
// WrapperType.SGA, // TODO: Create wrapper to reenable test
// WrapperType.TapeArchive, // TODO: Create wrapper to reenable test
// WrapperType.VBSP, // TODO: Create wrapper to reenable test
// WrapperType.VPK, // TODO: Create wrapper to reenable test
// WrapperType.WAD, // TODO: Create wrapper to reenable test
// WrapperType.XZ, // TODO: Create wrapper to reenable test
// WrapperType.XZP, // TODO: Create wrapper to reenable test
];
[Theory]
[MemberData(nameof(GenerateIExtractableTestData))]
public void CreateExtractableTests(WrapperType type, bool expectNull)
{
IExtractable? actual = Factory.CreateExtractable(type);
if (expectNull)
Assert.Null(actual);
else
Assert.NotNull(actual);
}
public static List<object?[]> GenerateIExtractableTestData()
{
var testData = new List<object?[]>();
foreach (WrapperType type in Enum.GetValues(typeof(WrapperType)))
{
if (_extractableTypes.Contains(type))
testData.Add([type, false]);
else
testData.Add([type, true]);
}
return testData;
}
#endregion
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class BFPKTests
{
private static readonly SabreTools.Serialization.Wrappers.BFPK wrapper
= new(new SabreTools.Models.BFPK.Archive(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new BFPK(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new BFPK(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new BFPK(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class BSPTests
{
private static readonly SabreTools.Serialization.Wrappers.BSP wrapper
= new(new SabreTools.Models.BSP.BspFile(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new BSP(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new BSP(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new BSP(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class BZip2Tests
{
private static readonly SabreTools.Serialization.Wrappers.BZip2 wrapper
= new(new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new BZip2(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new BZip2(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new BZip2(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class CFBTests
{
private static readonly SabreTools.Serialization.Wrappers.CFB wrapper
= new(new SabreTools.Models.CFB.Binary(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new CFB(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new CFB(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new CFB(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class GCFTests
{
private static readonly SabreTools.Serialization.Wrappers.GCF wrapper
= new(new SabreTools.Models.GCF.File(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new GCF(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new GCF(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new GCF(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class GZIPTests
{
private static readonly SabreTools.Serialization.Wrappers.GZip wrapper
= new(new SabreTools.Models.GZIP.Archive(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new GZip(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new GZip(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new GZip(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class InstallShieldArchiveV3Tests
{
private static readonly SabreTools.Serialization.Wrappers.InstallShieldArchiveV3 wrapper
= new(new SabreTools.Models.InstallShieldArchiveV3.Archive(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new InstallShieldArchiveV3(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new InstallShieldArchiveV3(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new InstallShieldArchiveV3(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class InstallShieldCABTests
{
private static readonly SabreTools.Serialization.Wrappers.InstallShieldCabinet wrapper
= new(new SabreTools.Models.InstallShieldCabinet.Cabinet(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new InstallShieldCAB(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new InstallShieldCAB(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new InstallShieldCAB(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class LZKWAJTests
{
private static readonly SabreTools.Serialization.Wrappers.LZKWAJ wrapper
= new(new SabreTools.Models.LZ.KWAJFile(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new LZKWAJ(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new LZKWAJ(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new LZKWAJ(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class LZQBasicTests
{
private static readonly SabreTools.Serialization.Wrappers.LZQBasic wrapper
= new(new SabreTools.Models.LZ.QBasicFile(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new LZQBasic(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new LZQBasic(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new LZQBasic(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class LZSZDDTests
{
private static readonly SabreTools.Serialization.Wrappers.LZSZDD wrapper
= new(new SabreTools.Models.LZ.SZDDFile(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new LZSZDD(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new LZSZDD(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new LZSZDD(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class MPQTests
{
private static readonly SabreTools.Serialization.Wrappers.MoPaQ wrapper
= new(new SabreTools.Models.MoPaQ.Archive(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new MPQ(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new MPQ(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new MPQ(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class MicrosoftCABTests
{
private static readonly SabreTools.Serialization.Wrappers.MicrosoftCabinet wrapper
= new(new SabreTools.Models.MicrosoftCabinet.Cabinet(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new MicrosoftCAB(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new MicrosoftCAB(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new MicrosoftCAB(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class PAKTests
{
private static readonly SabreTools.Serialization.Wrappers.PAK wrapper
= new(new SabreTools.Models.PAK.File(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new PAK(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new PAK(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new PAK(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class PFFTests
{
private static readonly SabreTools.Serialization.Wrappers.PFF wrapper
= new(new SabreTools.Models.PFF.Archive(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new PFF(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new PFF(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new PFF(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class PKZIPTests
{
private static readonly SabreTools.Serialization.Wrappers.PKZIP wrapper
= new(new SabreTools.Models.PKZIP.Archive(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new PKZIP(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new PKZIP(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new PKZIP(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class QuantumTests
{
private static readonly SabreTools.Serialization.Wrappers.Quantum wrapper
= new(new SabreTools.Models.Quantum.Archive(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new Quantum(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new Quantum(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new Quantum(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class RARTests
{
private static readonly SabreTools.Serialization.Wrappers.RAR wrapper
= new(new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new RAR(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new RAR(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new RAR(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -26,40 +26,5 @@ namespace BinaryObjectScanner.Test.FileType
string? actual = detectable.Detect(stream, file, includeDebug: false);
Assert.Null(actual);
}
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new SFFS();
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new SFFS();
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new SFFS();
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class SGATests
{
private static readonly SabreTools.Serialization.Wrappers.SGA wrapper
= new(new SabreTools.Models.SGA.Archive(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new SGA(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new SGA(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new SGA(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class SevenZipTests
{
private static readonly SabreTools.Serialization.Wrappers.SevenZip wrapper
= new(new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new SevenZip(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new SevenZip(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new SevenZip(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class TapeArchiveTests
{
private static readonly SabreTools.Serialization.Wrappers.TapeArchive wrapper
= new(new SabreTools.Models.TAR.Archive(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new TapeArchive(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new TapeArchive(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new TapeArchive(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class VBSPTests
{
private static readonly SabreTools.Serialization.Wrappers.VBSP wrapper
= new(new SabreTools.Models.BSP.VbspFile(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new VBSP(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new VBSP(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new VBSP(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class VPKTests
{
private static readonly SabreTools.Serialization.Wrappers.VPK wrapper
= new(new SabreTools.Models.VPK.File(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new VPK(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new VPK(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new VPK(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class WAD3Tests
{
private static readonly SabreTools.Serialization.Wrappers.WAD3 wrapper
= new(new SabreTools.Models.WAD3.File(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new WAD3(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new WAD3(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new WAD3(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class XZPTests
{
private static readonly SabreTools.Serialization.Wrappers.XZP wrapper
= new(new SabreTools.Models.XZP.File(), new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new XZP(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new XZP(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new XZP(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}

View File

@@ -1,47 +0,0 @@
using System.IO;
using BinaryObjectScanner.FileType;
using Xunit;
namespace BinaryObjectScanner.Test.FileType
{
public class XZTests
{
private static readonly SabreTools.Serialization.Wrappers.XZ wrapper
= new(new MemoryStream());
[Fact]
public void ExtractFile_EmptyString_False()
{
string file = string.Empty;
string outDir = string.Empty;
var extractable = new XZ(wrapper);
bool actual = extractable.Extract(file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Null_False()
{
Stream? stream = null;
string file = string.Empty;
string outDir = string.Empty;
var extractable = new XZ(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
[Fact]
public void ExtractStream_Empty_False()
{
Stream? stream = new MemoryStream();
string file = string.Empty;
string outDir = string.Empty;
var extractable = new XZ(wrapper);
bool actual = extractable.Extract(stream, file, outDir, includeDebug: false);
Assert.False(actual);
}
}
}