diff options
author | Alexander Kyte <alexmkyte@fastmail.com> | 2016-06-02 04:15:27 +0300 |
---|---|---|
committer | Alexander Kyte <alexmkyte@fastmail.com> | 2016-06-07 21:56:51 +0300 |
commit | ac19ad8a47d9c92f3fa726eb2bfb43f82aa63917 (patch) | |
tree | 20dd9e2ce0393f6bda897a50ced30902482fbdde /mcs/class/Mono.Security.Win32 | |
parent | 27e164695941b9ec554dc9b890edaab5663abfe2 (diff) |
[mobile_static] Remove uses of deprecated Assertion.cs nunit helper.
Diffstat (limited to 'mcs/class/Mono.Security.Win32')
4 files changed, 30 insertions, 30 deletions
diff --git a/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD2Test.cs b/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD2Test.cs index a6a92f06430..65b46010fc3 100644 --- a/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD2Test.cs +++ b/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD2Test.cs @@ -31,9 +31,9 @@ public class MD2Test { if ((array1 == null) && (array2 == null)) return; if (array1 == null) - Assertion.Fail (msg + " -> First array is NULL"); + Assert.Fail (msg + " -> First array is NULL"); if (array2 == null) - Assertion.Fail (msg + " -> Second array is NULL"); + Assert.Fail (msg + " -> Second array is NULL"); bool a = (array1.Length == array2.Length); if (a) { @@ -48,7 +48,7 @@ public class MD2Test { msg += " -> Expected " + BitConverter.ToString (array1, 0); msg += " is different than " + BitConverter.ToString (array2, 0); } - Assertion.Assert (msg, a); + Assert.IsTrue (a, msg); } // MD2 ("") = 8350e5a3e24c153df2275c9f80692773 @@ -208,7 +208,7 @@ public class MD2Test { for (int i=0; i < input.Length - 1; i++) hash.TransformBlock (input, i, 1, copy, i); byte[] output = hash.TransformFinalBlock (input, input.Length - 1, 1); - Assertion.AssertEquals (testName + ".e.1", input [input.Length - 1], output [0]); + Assert.AreEqual (input [input.Length - 1], output [0], testName + ".e.1"); AssertEquals (testName + ".e.2", result, hash.Hash); // required or next operation will still return old hash hash.Initialize (); @@ -218,9 +218,9 @@ public class MD2Test { public virtual void StaticInfo () { string className = hash.ToString (); - Assertion.AssertEquals (className + ".HashSize", 128, hash.HashSize); - Assertion.AssertEquals (className + ".InputBlockSize", 1, hash.InputBlockSize); - Assertion.AssertEquals (className + ".OutputBlockSize", 1, hash.OutputBlockSize); + Assert.AreEqual (128, hash.HashSize, className + ".HashSize",); + Assert.AreEqual (1, hash.InputBlockSize, className + ".InputBlockSize"); + Assert.AreEqual (1, hash.OutputBlockSize, className + ".OutputBlockSize"); } } diff --git a/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD4Test.cs b/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD4Test.cs index 308b689b91c..111035eb5ac 100644 --- a/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD4Test.cs +++ b/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD4Test.cs @@ -31,9 +31,9 @@ public class MD4Test { if ((array1 == null) && (array2 == null)) return; if (array1 == null) - Assertion.Fail (msg + " -> First array is NULL"); + Assert.Fail (msg + " -> First array is NULL"); if (array2 == null) - Assertion.Fail (msg + " -> Second array is NULL"); + Assert.Fail (msg + " -> Second array is NULL"); bool a = (array1.Length == array2.Length); if (a) { @@ -48,7 +48,7 @@ public class MD4Test { msg += " -> Expected " + BitConverter.ToString (array1, 0); msg += " is different than " + BitConverter.ToString (array2, 0); } - Assertion.Assert (msg, a); + Assert.IsTrue (a, msg); } // MD4 ("") = 31d6cfe0d16ae931b73c59d7e0c089c0 @@ -208,7 +208,7 @@ public class MD4Test { for (int i=0; i < input.Length - 1; i++) hash.TransformBlock (input, i, 1, copy, i); byte[] output = hash.TransformFinalBlock (input, input.Length - 1, 1); - Assertion.AssertEquals (testName + ".e.1", input [input.Length - 1], output [0]); + Assert.AreEqual (input [input.Length - 1], output [0], testName + ".e.1"); AssertEquals (testName + ".e.2", result, hash.Hash); // required or next operation will still return old hash hash.Initialize (); @@ -218,9 +218,9 @@ public class MD4Test { public virtual void StaticInfo () { string className = hash.ToString (); - Assertion.AssertEquals (className + ".HashSize", 128, hash.HashSize); - Assertion.AssertEquals (className + ".InputBlockSize", 1, hash.InputBlockSize); - Assertion.AssertEquals (className + ".OutputBlockSize", 1, hash.OutputBlockSize); + Assert.AreEqual (128, hash.HashSize, className + ".HashSize"); + Assert.AreEqual (1, hash.InputBlockSize, className + ".InputBlockSize"); + Assert.AreEqual (1, hash.OutputBlockSize, className + ".OutputBlockSize"); } } diff --git a/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD5Test.cs b/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD5Test.cs index 1eb70789380..a5796e910d7 100644 --- a/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD5Test.cs +++ b/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/MD5Test.cs @@ -33,9 +33,9 @@ public class MD5Test { if ((array1 == null) && (array2 == null)) return; if (array1 == null) - Assertion.Fail (msg + " -> First array is NULL"); + Assert.Fail (msg + " -> First array is NULL"); if (array2 == null) - Assertion.Fail (msg + " -> Second array is NULL"); + Assert.Fail (msg + " -> Second array is NULL"); bool a = (array1.Length == array2.Length); if (a) { @@ -50,7 +50,7 @@ public class MD5Test { msg += " -> Expected " + BitConverter.ToString (array1, 0); msg += " is different than " + BitConverter.ToString (array2, 0); } - Assertion.Assert (msg, a); + Assert.IsTrue (a, msg); } // MD5 ("") = d41d8cd98f00b204e9800998ecf8427e @@ -210,7 +210,7 @@ public class MD5Test { for (int i=0; i < input.Length - 1; i++) hash.TransformBlock (input, i, 1, copy, i); byte[] output = hash.TransformFinalBlock (input, input.Length - 1, 1); - Assertion.AssertEquals (testName + ".e.1", input [input.Length - 1], output [0]); + Assert.AreEqual (input [input.Length - 1], output [0], testName + ".e.1"); AssertEquals (testName + ".e.2", result, hash.Hash); // required or next operation will still return old hash hash.Initialize (); @@ -220,9 +220,9 @@ public class MD5Test { public virtual void StaticInfo () { string className = hash.ToString (); - Assertion.AssertEquals (className + ".HashSize", 128, hash.HashSize); - Assertion.AssertEquals (className + ".InputBlockSize", 1, hash.InputBlockSize); - Assertion.AssertEquals (className + ".OutputBlockSize", 1, hash.OutputBlockSize); + Assert.AreEqual (128, hash.HashSize, className + ".HashSize"); + Assert.AreEqual (1, hash.InputBlockSize, className + ".InputBlockSize"); + Assert.AreEqual (1, hash.OutputBlockSize, className + ".OutputBlockSize"); } } diff --git a/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/SHA1Test.cs b/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/SHA1Test.cs index 0ef2206f50b..358beca8d06 100644 --- a/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/SHA1Test.cs +++ b/mcs/class/Mono.Security.Win32/Test/Mono.Security.Cryptography/SHA1Test.cs @@ -33,9 +33,9 @@ public class SHA1Test { if ((array1 == null) && (array2 == null)) return; if (array1 == null) - Assertion.Fail (msg + " -> First array is NULL"); + Assert.Fail (msg + " -> First array is NULL"); if (array2 == null) - Assertion.Fail (msg + " -> Second array is NULL"); + Assert.Fail (msg + " -> Second array is NULL"); bool a = (array1.Length == array2.Length); if (a) { @@ -48,7 +48,7 @@ public class SHA1Test { } msg += " -> Expected " + BitConverter.ToString (array1, 0); msg += " is different than " + BitConverter.ToString (array2, 0); - Assertion.Assert (msg, a); + Assert.IsTrue (a, msg); } [SetUp] @@ -63,12 +63,12 @@ public class SHA1Test { { // test all values static for SHA1 string className = hash.ToString (); - Assertion.AssertEquals (className + ".HashSize", 160, hash.HashSize); - Assertion.AssertEquals (className + ".InputBlockSize", 1, hash.InputBlockSize); - Assertion.AssertEquals (className + ".OutputBlockSize", 1, hash.OutputBlockSize); - Assertion.AssertEquals (className + ".CanReuseTransform", true, hash.CanReuseTransform); - Assertion.AssertEquals (className + ".CanTransformMultipleBlocks", true, hash.CanTransformMultipleBlocks); - Assertion.AssertEquals (className + ".ToString()", "Mono.Security.Cryptography.SHA1CryptoServiceProvider", className); + Assert.AreEqual (className + ".HashSize", 160, hash.HashSize); + Assert.AreEqual (className + ".InputBlockSize", 1, hash.InputBlockSize); + Assert.AreEqual (className + ".OutputBlockSize", 1, hash.OutputBlockSize); + Assert.AreEqual (className + ".CanReuseTransform", true, hash.CanReuseTransform); + Assert.AreEqual (className + ".CanTransformMultipleBlocks", true, hash.CanTransformMultipleBlocks); + Assert.AreEqual (className + ".ToString()", "Mono.Security.Cryptography.SHA1CryptoServiceProvider", className); } // First test, we hash the string "abc" |