Files
Matt Nadareski d614379cf5 Libraries
This change looks dramatic, but it's just separating out the already-split namespaces into separate top-level folders. In theory, every single one could be built into their own Nuget package. `SabreTools.IO.Meta` builds the normal Nuget package that is used by all other projects and includes all namespaces. `SabreTools.IO` builds to `SabreTools.IO.Common` to avoid overwriting issues on publish.
2026-03-21 13:55:42 -04:00

32 lines
995 B
C#

using System;
using System.IO;
using SabreTools.IO.Compression.MSZIP;
using SabreTools.IO.Extensions;
using Xunit;
namespace SabreTools.IO.Compression.Test
{
public class MSZIPTests
{
[Fact]
public void DecompressorTest()
{
// Testing Note: This is a fake file that has multiple blocks
// sequentially. In real cabinet files, these are embedded in
// CFDATA blocks.
string path = Path.Combine(Environment.CurrentDirectory, "TestData", "test-archive.msz");
byte[] inputBytes = File.ReadAllBytes(path);
var input = new MemoryStream(inputBytes);
var output = new MemoryStream();
var decompressor = Decompressor.Create();
input.SeekIfPossible(0x0000);
decompressor.CopyTo(input, output);
input.SeekIfPossible(0x3969);
decompressor.CopyTo(input, output);
Assert.Equal(65536, output.Length);
}
}
}