mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-22 23:15:20 +00:00
7z encrypted filename exception with no password matches rar behaviour.
This commit is contained in:
@@ -17,12 +17,24 @@ namespace SharpCompress.Test.Rar
|
||||
ReadRarPassword("Rar.encrypted_filesAndHeader.rar", "test");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Rar_EncryptedFileAndHeader_NoPasswordExceptionTest()
|
||||
{
|
||||
Assert.Throws(typeof(CryptographicException), () => ReadRarPassword("Rar.encrypted_filesAndHeader.rar", null));
|
||||
}
|
||||
|
||||
/*[Fact]
|
||||
public void Rar5_EncryptedFileAndHeader_Archive()
|
||||
{
|
||||
ReadRarPassword("Rar5.encrypted_filesAndHeader.rar", "test");
|
||||
}*/
|
||||
|
||||
[Fact]
|
||||
public void Rar5_EncryptedFileAndHeader_NoPasswordExceptionTest()
|
||||
{
|
||||
Assert.Throws(typeof(CryptographicException), () => ReadRarPassword("Rar5.encrypted_filesAndHeader.rar", null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Rar_EncryptedFileOnly_Archive()
|
||||
{
|
||||
|
||||
@@ -41,6 +41,11 @@ namespace SharpCompress.Test.SevenZip
|
||||
ArchiveFileRead("7Zip.LZMA.Aes.7z", new ReaderOptions() { Password = "testpassword" });
|
||||
}
|
||||
[Fact]
|
||||
public void SevenZipArchive_LZMAAES_NoPasswordExceptionTest()
|
||||
{
|
||||
Assert.Throws(typeof(CryptographicException), () => ArchiveFileRead("7Zip.LZMA.Aes.7z", new ReaderOptions() { Password = null })); //was failing with ArgumentNullException not CryptographicException like rar
|
||||
}
|
||||
[Fact]
|
||||
public void SevenZipArchive_PPMd_StreamRead()
|
||||
{
|
||||
ArchiveStreamRead("7Zip.PPMd.7z");
|
||||
|
||||
Reference in New Issue
Block a user