New test.
[mono.git] / mcs / class / corlib / Test / System.Security.Cryptography / SymmetricAlgorithm2Test.cs
old mode 100755 (executable)
new mode 100644 (file)
index d0e7947..4fa9c6d
@@ -60,6 +60,20 @@ namespace MonoTests.System.Security.Cryptography {
                        }
                }
 
+               [Test]
+               public void BlockSize_SameSize () 
+               {
+                       using (SymmetricAlgorithm algo = SymmetricAlgorithm.Create ()) {
+                               // get a copy of the IV
+                               byte[] iv = algo.IV;
+                               int bs = algo.BlockSize;
+                               // set the iv size
+                               algo.BlockSize = bs;
+                               // did it change the IV ? No!
+                               Assert ("IV", BitConverter.ToString (iv) == BitConverter.ToString (algo.IV));
+                       }
+               }
+
                [Test]
                [ExpectedException (typeof (CryptographicException))]
                public void InvalidBlockSize () 
@@ -145,6 +159,9 @@ namespace MonoTests.System.Security.Cryptography {
                }
 
                [Test]
+#if NET_2_0
+               [ExpectedException (typeof (CryptographicException))]
+#endif
                public void FeedbackZero ()
                {
                        // thanks to Yakk for the sample