2026-01-03 17:18:00 +01:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using SharpCompress.Common;
|
|
|
|
|
using SharpCompress.Readers;
|
2026-01-03 19:09:43 +01:00
|
|
|
using SharpCompress.Readers.Ace;
|
2026-01-03 17:18:00 +01:00
|
|
|
using Xunit;
|
|
|
|
|
|
2026-02-04 09:25:48 +00:00
|
|
|
namespace SharpCompress.Test.Ace;
|
|
|
|
|
|
|
|
|
|
public class AceReaderTests : ReaderTests
|
2026-01-03 17:18:00 +01:00
|
|
|
{
|
2026-02-04 09:25:48 +00:00
|
|
|
public AceReaderTests()
|
2026-01-03 17:18:00 +01:00
|
|
|
{
|
2026-02-04 09:25:48 +00:00
|
|
|
UseExtensionInsteadOfNameToVerify = true;
|
|
|
|
|
UseCaseInsensitiveToVerify = true;
|
|
|
|
|
}
|
2026-01-03 17:18:00 +01:00
|
|
|
|
2026-02-04 09:25:48 +00:00
|
|
|
[Fact]
|
|
|
|
|
public void Ace_Uncompressed_Read() => Read("Ace.store.ace", CompressionType.None);
|
2026-01-03 17:18:00 +01:00
|
|
|
|
2026-02-04 09:25:48 +00:00
|
|
|
[Fact]
|
|
|
|
|
public void Ace_Encrypted_Read()
|
|
|
|
|
{
|
|
|
|
|
var exception = Assert.Throws<CryptographicException>(() => Read("Ace.encrypted.ace"));
|
|
|
|
|
}
|
2026-01-04 19:10:57 +01:00
|
|
|
|
2026-02-04 09:25:48 +00:00
|
|
|
[Theory]
|
|
|
|
|
[InlineData("Ace.method1.ace", CompressionType.AceLZ77)]
|
|
|
|
|
[InlineData("Ace.method1-solid.ace", CompressionType.AceLZ77)]
|
|
|
|
|
[InlineData("Ace.method2.ace", CompressionType.AceLZ77)]
|
|
|
|
|
[InlineData("Ace.method2-solid.ace", CompressionType.AceLZ77)]
|
|
|
|
|
public void Ace_Unsupported_ShouldThrow(string fileName, CompressionType compressionType)
|
|
|
|
|
{
|
|
|
|
|
var exception = Assert.Throws<NotSupportedException>(() => Read(fileName, compressionType));
|
|
|
|
|
}
|
2026-01-03 19:09:43 +01:00
|
|
|
|
2026-02-04 09:25:48 +00:00
|
|
|
[Theory]
|
|
|
|
|
[InlineData("Ace.store.largefile.ace", CompressionType.None)]
|
|
|
|
|
public void Ace_LargeFileTest_Read(string fileName, CompressionType compressionType)
|
|
|
|
|
{
|
|
|
|
|
ReadForBufferBoundaryCheck(fileName, compressionType);
|
|
|
|
|
}
|
2026-01-03 19:09:43 +01:00
|
|
|
|
2026-02-04 09:25:48 +00:00
|
|
|
[Fact]
|
|
|
|
|
public void Ace_Multi_Reader()
|
|
|
|
|
{
|
|
|
|
|
var exception = Assert.Throws<MultiVolumeExtractionException>(() =>
|
|
|
|
|
DoMultiReader(
|
|
|
|
|
["Ace.store.split.ace", "Ace.store.split.c01"],
|
|
|
|
|
streams => AceReader.OpenReader(streams)
|
|
|
|
|
)
|
|
|
|
|
);
|
2026-01-03 17:18:00 +01:00
|
|
|
}
|
|
|
|
|
}
|