Browse Source

2005-04-26 Sebastien Pouliot <[email protected]>

	* AlgorithmIdentifierTest.cs: Complete some test cases. Updated to 
	NUnit 2.2 API.
	* SignedCmsTest.cs: Added [Ignore] to 3 tests that now also fails
	on beta2.


svn path=/trunk/mcs/; revision=43616
Sebastien Pouliot 20 years ago
parent
commit
d4d3a94fa4

+ 27 - 18
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/AlgorithmIdentifierTest.cs

@@ -38,7 +38,7 @@ using System.Security.Cryptography.Pkcs;
 namespace MonoTests.System.Security.Cryptography.Pkcs {
 
 	[TestFixture]
-	public class AlgorithmIdentifierTest : Assertion {
+	public class AlgorithmIdentifierTest {
 
 		static string defaultOid = "1.2.840.113549.3.7";
 		static string defaultName = "3des";
@@ -48,10 +48,10 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 		public void ConstructorEmpty () 
 		{
 			AlgorithmIdentifier ai = new AlgorithmIdentifier ();
-			AssertEquals ("KeyLength", 0, ai.KeyLength);
-			AssertEquals ("Oid.FriendlyName", defaultName, ai.Oid.FriendlyName);
-			AssertEquals ("Oid.Value", defaultOid, ai.Oid.Value);
-			AssertEquals ("Parameters", 0, ai.Parameters.Length);
+			Assert.AreEqual (0, ai.KeyLength, "KeyLength");
+			Assert.AreEqual (defaultName, ai.Oid.FriendlyName, "Oid.FriendlyName");
+			Assert.AreEqual (defaultOid, ai.Oid.Value, "Oid.Value");
+			Assert.AreEqual (0, ai.Parameters.Length, "Parameters");
 		}
 
 		[Test]
@@ -59,9 +59,9 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 		{
 			Oid o = new Oid (validOid);
 			AlgorithmIdentifier ai = new AlgorithmIdentifier (o);
-			AssertEquals ("KeyLength", 0, ai.KeyLength);
-			AssertEquals ("Oid", validOid, ai.Oid.Value);
-			AssertEquals ("Parameters", 0, ai.Parameters.Length);
+			Assert.AreEqual (0, ai.KeyLength, "KeyLength");
+			Assert.AreEqual (validOid, ai.Oid.Value, "Oid");
+			Assert.AreEqual (0, ai.Parameters.Length, "Parameters");
 		}
 
 		[Test]
@@ -69,6 +69,9 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 		public void ConstructorOidNull () 
 		{
 			AlgorithmIdentifier ai = new AlgorithmIdentifier (null);
+			Assert.IsNull (ai.Oid, "Oid");
+			Assert.AreEqual (0, ai.KeyLength, "KeyLength");
+			Assert.AreEqual (0, ai.Parameters.Length, "Parameters");
 		}
 
 		[Test]
@@ -76,9 +79,9 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 		{
 			Oid o = new Oid (validOid);
 			AlgorithmIdentifier ai = new AlgorithmIdentifier (o, 128);
-			AssertEquals ("KeyLength", 128, ai.KeyLength);
-			AssertEquals ("Oid", validOid, ai.Oid.Value);
-			AssertEquals ("Parameters", 0, ai.Parameters.Length);
+			Assert.AreEqual (128, ai.KeyLength, "KeyLength");
+			Assert.AreEqual (validOid, ai.Oid.Value, "Oid");
+			Assert.AreEqual (0, ai.Parameters.Length, "Parameters");
 		}
 
 		[Test]
@@ -86,6 +89,9 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 		public void ConstructorOidNullKeyLength () 
 		{
 			AlgorithmIdentifier ai = new AlgorithmIdentifier (null, 128);
+			Assert.IsNull (ai.Oid, "Oid");
+			Assert.AreEqual (128, ai.KeyLength, "KeyLength");
+			Assert.AreEqual (0, ai.Parameters.Length, "Parameters");
 		}
 
 		[Test]
@@ -94,6 +100,9 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 		{
 			Oid o = new Oid (validOid);
 			AlgorithmIdentifier ai = new AlgorithmIdentifier (o, -1);
+			Assert.AreEqual (-1, ai.KeyLength, "KeyLength");
+			Assert.AreEqual (validOid, ai.Oid.Value, "Oid");
+			Assert.AreEqual (0, ai.Parameters.Length, "Parameters");
 		}
 
 		[Test]
@@ -101,11 +110,11 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 		{
 			AlgorithmIdentifier ai = new AlgorithmIdentifier ();
 			ai.KeyLength = Int32.MaxValue;
-			AssertEquals ("KeyLength-Max", Int32.MaxValue, ai.KeyLength);
+			Assert.AreEqual (Int32.MaxValue, ai.KeyLength, "KeyLength-Max");
 			ai.KeyLength = 0;
-			AssertEquals ("KeyLength-Zero", 0, ai.KeyLength);
+			Assert.AreEqual (0, ai.KeyLength, "KeyLength-Zero");
 			ai.KeyLength = Int32.MinValue;
-			AssertEquals ("KeyLength-Min", Int32.MinValue, ai.KeyLength);
+			Assert.AreEqual (Int32.MinValue, ai.KeyLength, "KeyLength-Min");
 		}
 
 		[Test]
@@ -113,9 +122,9 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 		{
 			AlgorithmIdentifier ai = new AlgorithmIdentifier ();
 			ai.Oid = new Oid (validOid);
-			AssertEquals ("Oid", validOid, ai.Oid.Value);
+			Assert.AreEqual (validOid, ai.Oid.Value, "Oid");
 			ai.Oid = null;
-			AssertNull ("Oid", ai.Oid);
+			Assert.IsNull (ai.Oid, "Oid-Null");
 		}
 
 		[Test]
@@ -123,9 +132,9 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 		{
 			AlgorithmIdentifier ai = new AlgorithmIdentifier ();
 			ai.Parameters = new byte[2] { 0x05, 0x00 }; // ASN.1 NULL
-			AssertEquals ("Oid", "05-00", BitConverter.ToString (ai.Parameters));
+			Assert.AreEqual ("05-00", BitConverter.ToString (ai.Parameters), "Parameters");
 			ai.Parameters = null;
-			AssertNull ("Parameters", ai.Parameters);
+			Assert.IsNull (ai.Parameters, "Parameters-Null");
 		}
 	}
 }

+ 7 - 0
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/ChangeLog

@@ -1,3 +1,10 @@
+2005-04-26  Sebastien Pouliot  <[email protected]>
+
+	* AlgorithmIdentifierTest.cs: Complete some test cases. Updated to 
+	NUnit 2.2 API.
+	* SignedCmsTest.cs: Added [Ignore] to 3 tests that now also fails
+	on beta2.
+
 2005-04-23  Sebastien Pouliot  <[email protected]>
 
 	* CmsRecipientTest.cs, CmsSignerTest.cs, EnvelopedCmsTest.cs,

+ 4 - 1
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/SignedCmsTest.cs

@@ -5,7 +5,7 @@
 //	Sebastien Pouliot  <[email protected]>
 //
 // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -299,6 +299,7 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 		}
 
 		[Test]
+		[Ignore ("now broken everywhere")]
 		public void ComputeSignatureCmsSignerIssuerAndSerialNumber () 
 		{
 			ContentInfo ci = new ContentInfo (asnNull);
@@ -320,6 +321,7 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 		}
 
 		[Test]
+		[Ignore ("now broken everywhere")]
 		public void ComputeSignatureCmsSignerSubjectKeyIdentifier () 
 		{
 			ContentInfo ci = new ContentInfo (asnNull);
@@ -341,6 +343,7 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 		}
 
 		[Test]
+		[Ignore ("now broken everywhere")]
 		public void ComputeSignatureCmsSignerUnknown () 
 		{
 			ContentInfo ci = new ContentInfo (asnNull);