Use more SC exceptions instead of generic ones

This commit is contained in:
Adam Hathcock
2026-02-16 12:40:07 +00:00
parent 0cb9e5e970
commit 855d4b4ce2
113 changed files with 345 additions and 281 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Threading.Tasks;
using SharpCompress.Common;
using SharpCompress.IO;
using Xunit;
@@ -56,7 +57,7 @@ public class SharpCompressStreamErrorAsyncTest
var stream = SharpCompressStream.CreateNonDisposing(ms);
stream.ThrowOnDispose = true;
await Assert
.ThrowsAsync<InvalidOperationException>(async () =>
.ThrowsAsync<ArchiveOperationException>(async () =>
await stream.DisposeAsync().ConfigureAwait(false)
)
.ConfigureAwait(false);
@@ -108,7 +109,7 @@ public class SharpCompressStreamErrorAsyncTest
{
await stream.ReadExactAsync(buffer, 0, 32).ConfigureAwait(false);
}
Assert.Throws<InvalidOperationException>(() => stream.Rewind());
Assert.Throws<ArchiveOperationException>(() => stream.Rewind());
}
[Fact]