Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove supported method checks from the ZipEntry.CompressionMethod property setter #587

Merged
merged 1 commit into from May 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/ICSharpCode.SharpZipLib/Zip/ZipEntry.cs
Expand Up @@ -724,17 +724,13 @@ public long Crc
/// <summary>
/// Gets/Sets the compression method.
/// </summary>
/// <remarks>Throws exception when set if the method is not valid as per <see cref="IsCompressionMethodSupported()"/></remarks>
/// <exception cref="NotSupportedException"/>
/// <returns>
/// The compression method for this entry
/// </returns>
public CompressionMethod CompressionMethod
{
get => method;
set => method = !IsCompressionMethodSupported(value)
? throw new NotSupportedException("Compression method not supported")
: value;
set => method = value;
}

/// <summary>
Expand Down
12 changes: 0 additions & 12 deletions test/ICSharpCode.SharpZipLib.Tests/Zip/GeneralHandling.cs
Expand Up @@ -133,18 +133,6 @@ private string DescribeAttributes(FieldAttributes attributes)
return att;
}

[Test]
[Category("Zip")]
//[ExpectedException(typeof(NotSupportedException))]
public void UnsupportedCompressionMethod()
{
var ze = new ZipEntry("HumblePie");
//ze.CompressionMethod = CompressionMethod.BZip2;

Assert.That(() => ze.CompressionMethod = CompressionMethod.Deflate64,
Throws.TypeOf<NotSupportedException>());
}

/// <summary>
/// Invalid passwords should be detected early if possible, seekable stream
/// </summary>
Expand Down