Преглед на файлове

Change few Assertions to Asserts

Marek Safar преди 14 години
родител
ревизия
db7131d010

+ 1 - 5
mcs/class/corlib/Test/System.Collections/NewArrayListTest.cs

@@ -1339,11 +1339,7 @@ namespace MonoTests.System.Collections
 					}				
 				}
 
-				Assertion.Assert
-					(
-					String.Format("Reverse on arrayList failed on list with {0} items.", x),
-					ok
-					);
+				Assert.IsTrue (ok, String.Format("Reverse on arrayList failed on list with {0} items.", x));
 			}
 		}
 

+ 2 - 2
mcs/class/corlib/Test/System.Security.Cryptography.X509Certificates/X509CertificateTest.cs

@@ -564,13 +564,13 @@ public void Certificate7 ()
 		0xE5,0xBF,0x3C,0xC9,0xED,0x93,0x20,0x2D,0x52,0x21,0xE9,0xBC,0xB9,0xE3,0x4F,0xAC,0x11,0x65,0x0E,0x8F,0xA1,0x68,0x99,0x63,0x47,0xE5,0x3D,0xE4,0x42,0x73,0x13,0xFA,0xC5,0xC8,0x34,0x8C,0xC0,0x41,0x18,0x89,0xD5,0xE6,0xA0,0x18,0x5B,0x5D,0x86,0x1C,0x1E,0xC6,0x70,0xD8,0x0E,0x89,0x64,0x94,0x83,0x8E,0x3B,0x40,0x7C,0x59,0xCF,0x2B,0x2F,0xB7,0xCE,0x97,0x98,0x12,0x15,0xEF,0x13,0xD4,0x00,0x00 };
 
 		X509Certificate bad = new X509Certificate (cert);
-		Assertion.Fail ("Expected CryptographicException but got none");
+		Assert.Fail ("Expected CryptographicException but got none");
 	}
 	catch (CryptographicException) {
 		// this is expected 
 	}
 	catch (Exception e) {
-		Assertion.Fail ("Expected CryptographicException but got :" + e.ToString ());
+		Assert.Fail ("Expected CryptographicException but got :" + e.ToString ());
 	}
 }
 

+ 5 - 5
mcs/class/corlib/Test/System.Security.Cryptography/PKCS1MaskGenerationMethodTest.cs

@@ -57,15 +57,15 @@ namespace MonoTests.System.Security.Cryptography {
 		public void Properties () 
 		{
 			// default value
-			Assertion.AssertEquals ("PKCS1MaskGenerationMethod HashName(default)", "SHA1", pkcs1.HashName);
+			Assert.AreEqual ("SHA1", pkcs1.HashName, "PKCS1MaskGenerationMethod HashName(default)");
 			// return to default
 			pkcs1.HashName = null;
-			Assertion.AssertEquals ("PKCS1MaskGenerationMethod HashName(null)", "SHA1", pkcs1.HashName);
+			Assert.AreEqual ("SHA1", pkcs1.HashName, "PKCS1MaskGenerationMethod HashName(null)");
 			// bad hash accepted
 			pkcs1.HashName = "SHA2";
-			Assertion.AssertEquals ("PKCS1MaskGenerationMethod HashName(bad)", "SHA2", pkcs1.HashName);
+			Assert.AreEqual ("SHA2", pkcs1.HashName, "PKCS1MaskGenerationMethod HashName(bad)");
 			// tostring
-			Assertion.AssertEquals ("PKCS1MaskGenerationMethod ToString()", "System.Security.Cryptography.PKCS1MaskGenerationMethod", pkcs1.ToString ());
+			Assert.AreEqual ("System.Security.Cryptography.PKCS1MaskGenerationMethod", pkcs1.ToString ());
 		}
 
 		[Test]
@@ -74,7 +74,7 @@ namespace MonoTests.System.Security.Cryptography {
 			// pretty much useless but supported
 			byte[] random = { 0x01 };
 			byte[] mask = pkcs1.GenerateMask (random, 0);
-			Assertion.AssertEquals ("PKCS1MaskGenerationMethod Empty Mask", 0, mask.Length);
+			Assert.AreEqual (0, mask.Length, "PKCS1MaskGenerationMethod Empty Mask");
 		}
 
 		[Test]

+ 6 - 6
mcs/class/corlib/Test/System.Text/StringBuilderTest.cs

@@ -79,7 +79,7 @@ namespace MonoTests.System.Text {
 				return;
 			}
 			// if we didn't catch an exception, then we have a problem Houston.
-			NUnit.Framework.Assertion.Fail("Capacity exceeds MaxCapacity");
+			Assert.Fail("Capacity exceeds MaxCapacity");
 		}
 
 		[Test]
@@ -100,7 +100,7 @@ namespace MonoTests.System.Text {
 			return;
 		}
 		// if we didn't catch an exception, then we have a problem Houston.
-		NUnit.Framework.Assertion.Fail("StartIndex not allowed to be less than zero.");
+		Assert.Fail("StartIndex not allowed to be less than zero.");
 	}
 
 		[Test]
@@ -114,7 +114,7 @@ namespace MonoTests.System.Text {
 			return;
 		}
 		// if we didn't catch an exception, then we have a problem Houston.
-		NUnit.Framework.Assertion.Fail("Length not allowed to be less than zero.");
+		Assert.Fail("Length not allowed to be less than zero.");
 	}
 
 		[Test]
@@ -129,7 +129,7 @@ namespace MonoTests.System.Text {
 			return;
 		}
 		// if we didn't catch an exception, then we have a problem Houston.
-		NUnit.Framework.Assertion.Fail("StartIndex and length must refer to a location within the string.");
+		Assert.Fail ("StartIndex and length must refer to a location within the string.");
 	}
 
 		[Test]
@@ -144,7 +144,7 @@ namespace MonoTests.System.Text {
 			return;
 		}
 		// if we didn't catch an exception, then we have a problem Houston.
-		NUnit.Framework.Assertion.Fail("StartIndex and length must refer to a location within the string.");
+		Assert.Fail ("StartIndex and length must refer to a location within the string.");
 	}
 
 		[Test]
@@ -307,7 +307,7 @@ namespace MonoTests.System.Text {
 		
 		try {
 			sb.Insert (1, null, 1, 1);
-			Assertion.Fail ("#04: Value must not be null if startIndex and charCount > 0");
+			Assert.Fail ("#04: Value must not be null if startIndex and charCount > 0");
 		} catch (ArgumentNullException) {}
 	}