You've already forked linux-packaging-mono
Imported Upstream version 5.8.0.22
Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
parent
5f4a27cc8a
commit
7d05485754
@@ -15,9 +15,9 @@ namespace System.Security.Cryptography.Encryption.Tests.Asymmetric
|
||||
public static void Ctor()
|
||||
{
|
||||
var transform = new IdentityTransform(1, 1, true);
|
||||
Assert.Throws<ArgumentException>(() => new CryptoStream(new MemoryStream(), transform, (CryptoStreamMode)12345));
|
||||
Assert.Throws<ArgumentException>(() => new CryptoStream(new MemoryStream(new byte[0], writable: false), transform, CryptoStreamMode.Write));
|
||||
Assert.Throws<ArgumentException>(() => new CryptoStream(new CryptoStream(new MemoryStream(new byte[0]), transform, CryptoStreamMode.Write), transform, CryptoStreamMode.Read));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => new CryptoStream(new MemoryStream(), transform, (CryptoStreamMode)12345));
|
||||
AssertExtensions.Throws<ArgumentException>(null, "stream", () => new CryptoStream(new MemoryStream(new byte[0], writable: false), transform, CryptoStreamMode.Write));
|
||||
AssertExtensions.Throws<ArgumentException>(null, "stream", () => new CryptoStream(new CryptoStream(new MemoryStream(new byte[0]), transform, CryptoStreamMode.Write), transform, CryptoStreamMode.Read));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -51,7 +51,7 @@ namespace System.Security.Cryptography.Encryption.Tests.Asymmetric
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => encryptStream.Write(new byte[0], -1, 0));
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => encryptStream.Write(new byte[0], 0, -1));
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => encryptStream.Write(new byte[0], 0, -1));
|
||||
Assert.Throws<ArgumentException>(() => encryptStream.Write(new byte[3], 1, 4));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => encryptStream.Write(new byte[3], 1, 4));
|
||||
|
||||
byte[] toWrite = Encoding.UTF8.GetBytes(LoremText);
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace System.Security.Cryptography.Encryption.Tests.Asymmetric
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => decryptStream.Read(new byte[0], -1, 0));
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => decryptStream.Read(new byte[0], 0, -1));
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => decryptStream.Read(new byte[0], 0, -1));
|
||||
Assert.Throws<ArgumentException>(() => decryptStream.Read(new byte[3], 1, 4));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => decryptStream.Read(new byte[3], 1, 4));
|
||||
|
||||
using (StreamReader reader = new StreamReader(decryptStream))
|
||||
{
|
||||
|
@@ -122,9 +122,9 @@ namespace System.Security.Cryptography.Hashing.Tests
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => hash.ComputeHash((byte[])null, 0, 0));
|
||||
Assert.Throws<ArgumentOutOfRangeException>(() => hash.ComputeHash(s_tenBytes, -1, 0));
|
||||
Assert.Throws<ArgumentException>(() => hash.ComputeHash(s_tenBytes, 0, -1));
|
||||
Assert.Throws<ArgumentException>(() => hash.ComputeHash(s_tenBytes, 0, 11));
|
||||
Assert.Throws<ArgumentException>(() => hash.ComputeHash(s_tenBytes, 9, 2));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => hash.ComputeHash(s_tenBytes, 0, -1));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => hash.ComputeHash(s_tenBytes, 0, 11));
|
||||
AssertExtensions.Throws<ArgumentException>(null, () => hash.ComputeHash(s_tenBytes, 9, 2));
|
||||
|
||||
hash.Dispose();
|
||||
|
||||
|
Reference in New Issue
Block a user