V13-FE-011: finalize search list layout slice
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using System.IO.Compression;
|
||||
using Xunit;
|
||||
|
||||
namespace Shared.Excel.Tests;
|
||||
|
||||
public sealed class XlsxSafetyInspectorTests
|
||||
{
|
||||
[Fact]
|
||||
public void Rejects_zip_without_xlsx_structure()
|
||||
{
|
||||
using var stream = new MemoryStream();
|
||||
using (var zip = new ZipArchive(stream, ZipArchiveMode.Create, true))
|
||||
{
|
||||
var entry = zip.CreateEntry("hello.txt");
|
||||
using var writer = new StreamWriter(entry.Open());
|
||||
writer.Write("not an xlsx");
|
||||
}
|
||||
Assert.Throws<InvalidDataException>(() => new XlsxSafetyInspector().EnsureSafe(stream.ToArray()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user