2009-06-26 Robert Jordan <robertj@gmx.net>
authorRobert Jordan <robertj@gmx.net>
Fri, 26 Jun 2009 14:00:28 +0000 (14:00 -0000)
committerRobert Jordan <robertj@gmx.net>
Fri, 26 Jun 2009 14:00:28 +0000 (14:00 -0000)
* *.cs: Upgrade to new NUnit style.

svn path=/trunk/mcs/; revision=136962

mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/ChangeLog
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/CmsRecipientTest.cs
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/CmsSignerTest.cs
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/CryptographicAttributeTest.cs
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/EnvelopedCmsTest.cs
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/KeyTransRecipientInfoTest.cs
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/SignedCmsTest.cs
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/SignerInfoTest.cs
mcs/class/System.Security/Test/System.Security.Cryptography.Pkcs/SubjectIdentifierTest.cs

index 81e50eb39c08debcad356ddc8c42233a345ce2f9..6d222505d7a7cf416f8c90ac54ba213c8098b5a7 100644 (file)
@@ -1,3 +1,7 @@
+2009-06-26  Robert Jordan  <robertj@gmx.net>
+
+       * *.cs: Upgrade to new NUnit style.
+
 2008-11-01  Sebastien Pouliot  <sebastien@ximian.com>
 
        * CmsRecipientCollectionTest.cs: Verify NRE behavior of ctor.
index 9cafb5437216ae859062e5c39f85fa7020760dde..c05141afb3522bd9d023997e5d6eca264748ad2f 100644 (file)
@@ -41,7 +41,7 @@ using System.Security.Cryptography.Xml;
 namespace MonoTests.System.Security.Cryptography.Pkcs {
 
        [TestFixture]
-       public class CmsRecipientTest : Assertion {
+       public class CmsRecipientTest {
 
                static public byte [] farscape_p12_pfx = { 
                        0x30, 0x82, 0x07, 0x17, 0x02, 0x01, 0x03, 0x30, 0x82, 0x06, 0xD3, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01, 0xA0, 0x82, 0x06, 0xC4, 0x04, 0x82, 0x06, 0xC0, 0x30, 0x82, 0x06, 0xBC, 0x30, 0x82, 0x03, 0xCD, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01, 0xA0, 0x82, 0x03, 0xBE, 0x04, 0x82, 0x03, 0xBA, 0x30, 0x82, 0x03, 0xB6, 0x30, 0x82, 0x03, 0xB2, 0x06, 0x0B, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x0C, 0x0A, 0x01, 0x02, 0xA0, 0x82, 0x02, 0xB6, 0x30, 0x82, 0x02, 0xB2, 0x30, 0x1C, 0x06, 0x0A, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x0C, 0x01, 0x03, 0x30, 
@@ -74,8 +74,8 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        X509Certificate2 x509 = GetCertificate (true);
                        CmsRecipient p7r = new CmsRecipient (SubjectIdentifierType.IssuerAndSerialNumber, x509);
-                       AssertEquals ("RecipientIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, p7r.RecipientIdentifierType);
-                       AssertEquals ("Certificate", x509.Thumbprint, p7r.Certificate.Thumbprint);
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, p7r.RecipientIdentifierType, "RecipientIdentifierType");
+                       Assert.AreEqual (x509.Thumbprint, p7r.Certificate.Thumbprint, "Certificate");
                }
 
                [Test]
@@ -83,8 +83,8 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        X509Certificate2 x509 = GetCertificate (true);
                        CmsRecipient p7r = new CmsRecipient (SubjectIdentifierType.SubjectKeyIdentifier, x509);
-                       AssertEquals ("RecipientIdentifierType", SubjectIdentifierType.SubjectKeyIdentifier, p7r.RecipientIdentifierType);
-                       AssertEquals ("Certificate", x509.Thumbprint, p7r.Certificate.Thumbprint);
+                       Assert.AreEqual (SubjectIdentifierType.SubjectKeyIdentifier, p7r.RecipientIdentifierType, "RecipientIdentifierType");
+                       Assert.AreEqual (x509.Thumbprint, p7r.Certificate.Thumbprint, "Certificate");
                }
 
                [Test]
@@ -92,8 +92,8 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        X509Certificate2 x509 = GetCertificate (true);
                        CmsRecipient p7r = new CmsRecipient (SubjectIdentifierType.Unknown, x509);
-                       AssertEquals ("RecipientIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, p7r.RecipientIdentifierType);
-                       AssertEquals ("Certificate", x509.Thumbprint, p7r.Certificate.Thumbprint);
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, p7r.RecipientIdentifierType, "RecipientIdentifierType");
+                       Assert.AreEqual (x509.Thumbprint, p7r.Certificate.Thumbprint, "Certificate");
                }
 
                [Test]
index 9082ee26a399dec461f7cd39c39b73a03d0ac71a..0f7b21b3bfcafec62a16593781e3753083984d63 100644 (file)
@@ -40,7 +40,7 @@ using System.Security.Cryptography.X509Certificates;
 namespace MonoTests.System.Security.Cryptography.Pkcs {
 
        [TestFixture]
-       public class CmsSignerTest : Assertion {
+       public class CmsSignerTest {
 
                static byte[] asnNull = { 0x05, 0x00 };
                static string sha1Oid = "1.3.14.3.2.26";
@@ -53,13 +53,13 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        CmsSigner ps = new CmsSigner ();
                        // default properties
-                       AssertEquals ("SignedAttributes", 0, ps.SignedAttributes.Count);
-                       AssertNull ("Certificate", ps.Certificate);
-                       AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-                       AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-                       AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-                       AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-                       AssertEquals ("UnsignedAttributes", 0, ps.UnsignedAttributes.Count);
+                       Assert.AreEqual (0, ps.SignedAttributes.Count, "SignedAttributes");
+                       Assert.IsNull (ps.Certificate, "Certificate");
+                       Assert.AreEqual (sha1Name, ps.DigestAlgorithm.FriendlyName, "DigestAlgorithm.FriendlyName");
+                       Assert.AreEqual (sha1Oid, ps.DigestAlgorithm.Value, "DigestAlgorithm.Value");
+                       Assert.AreEqual (X509IncludeOption.ExcludeRoot, ps.IncludeOption, "IncludeOption");
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType, "SignerIdentifierType");
+                       Assert.AreEqual (0, ps.UnsignedAttributes.Count, "UnsignedAttributes");
                }
 
                [Test]
@@ -67,13 +67,13 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        CmsSigner ps = new CmsSigner (SubjectIdentifierType.IssuerAndSerialNumber);
                        // default properties
-                       AssertEquals ("SignedAttributes", 0, ps.SignedAttributes.Count);
-                       AssertNull ("Certificate", ps.Certificate);
-                       AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-                       AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-                       AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-                       AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-                       AssertEquals ("UnsignedAttributes", 0, ps.UnsignedAttributes.Count);
+                       Assert.AreEqual (0, ps.SignedAttributes.Count, "SignedAttributes");
+                       Assert.IsNull (ps.Certificate, "Certificate");
+                       Assert.AreEqual (sha1Name, ps.DigestAlgorithm.FriendlyName, "DigestAlgorithm.FriendlyName");
+                       Assert.AreEqual (sha1Oid, ps.DigestAlgorithm.Value, "DigestAlgorithm.Value");
+                       Assert.AreEqual (X509IncludeOption.ExcludeRoot, ps.IncludeOption, "IncludeOption");
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType, "SignerIdentifierType");
+                       Assert.AreEqual (0, ps.UnsignedAttributes.Count, "UnsignedAttributes");
                }
 
                [Test]
@@ -81,13 +81,13 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        CmsSigner ps = new CmsSigner (SubjectIdentifierType.SubjectKeyIdentifier);
                        // default properties
-                       AssertEquals ("SignedAttributes", 0, ps.SignedAttributes.Count);
-                       AssertNull ("Certificate", ps.Certificate);
-                       AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-                       AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-                       AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-                       AssertEquals ("SignerIdentifierType", SubjectIdentifierType.SubjectKeyIdentifier, ps.SignerIdentifierType);
-                       AssertEquals ("UnsignedAttributes", 0, ps.UnsignedAttributes.Count);
+                       Assert.AreEqual (0, ps.SignedAttributes.Count, "SignedAttributes");
+                       Assert.IsNull (ps.Certificate, "Certificate");
+                       Assert.AreEqual (sha1Name, ps.DigestAlgorithm.FriendlyName, "DigestAlgorithm.FriendlyName");
+                       Assert.AreEqual (sha1Oid, ps.DigestAlgorithm.Value, "DigestAlgorithm.Value");
+                       Assert.AreEqual (X509IncludeOption.ExcludeRoot, ps.IncludeOption, "IncludeOption");
+                       Assert.AreEqual (SubjectIdentifierType.SubjectKeyIdentifier, ps.SignerIdentifierType, "SignerIdentifierType");
+                       Assert.AreEqual (0, ps.UnsignedAttributes.Count, "UnsignedAttributes");
                }
 
                [Test]
@@ -95,14 +95,14 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        CmsSigner ps = new CmsSigner (SubjectIdentifierType.Unknown);
                        // default properties
-                       AssertEquals ("SignedAttributes", 0, ps.SignedAttributes.Count);
-                       AssertNull ("Certificate", ps.Certificate);
-                       AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-                       AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-                       AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
+                       Assert.AreEqual (0, ps.SignedAttributes.Count, "SignedAttributes");
+                       Assert.IsNull (ps.Certificate, "Certificate");
+                       Assert.AreEqual (sha1Name, ps.DigestAlgorithm.FriendlyName, "DigestAlgorithm.FriendlyName");
+                       Assert.AreEqual (sha1Oid, ps.DigestAlgorithm.Value, "DigestAlgorithm.Value");
+                       Assert.AreEqual (X509IncludeOption.ExcludeRoot, ps.IncludeOption, "IncludeOption");
                        // Unknown is converted to IssuerAndSerialNumber
-                       AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-                       AssertEquals ("UnsignedAttributes", 0, ps.UnsignedAttributes.Count);
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType, "SignerIdentifierType");
+                       Assert.AreEqual (0, ps.UnsignedAttributes.Count, "UnsignedAttributes");
                }
 
                // TODO: return valid x509 certifiate with private key
@@ -118,13 +118,13 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        X509Certificate2 x509 = GetValidCertificateWithPrivateKey ();
                        CmsSigner ps = new CmsSigner (x509);
                        // default properties
-                       AssertEquals ("SignedAttributes", 0, ps.SignedAttributes.Count);
-                       AssertNotNull ("Certificate", ps.Certificate);
-                       AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-                       AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-                       AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-                       AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-                       AssertEquals ("UnsignedAttributes", 0, ps.UnsignedAttributes.Count);
+                       Assert.AreEqual (0, ps.SignedAttributes.Count, "SignedAttributes");
+                       Assert.IsNotNull (ps.Certificate, "Certificate");
+                       Assert.AreEqual (sha1Name, ps.DigestAlgorithm.FriendlyName, "DigestAlgorithm.FriendlyName");
+                       Assert.AreEqual (sha1Oid, ps.DigestAlgorithm.Value, "DigestAlgorithm.Value");
+                       Assert.AreEqual (X509IncludeOption.ExcludeRoot, ps.IncludeOption, "IncludeOption");
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType, "SignerIdentifierType");
+                       Assert.AreEqual (0, ps.UnsignedAttributes.Count, "UnsignedAttributes");
                }
 
                [Test]
@@ -133,13 +133,13 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        X509Certificate2 x509 = new X509Certificate2 (); // empty
                        CmsSigner ps = new CmsSigner (x509);
                        // default properties
-                       AssertEquals ("SignedAttributes", 0, ps.SignedAttributes.Count);
-                       AssertNotNull ("Certificate", ps.Certificate);
-                       AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-                       AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-                       AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-                       AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-                       AssertEquals ("UnsignedAttributes", 0, ps.UnsignedAttributes.Count);
+                       Assert.AreEqual (0, ps.SignedAttributes.Count, "SignedAttributes");
+                       Assert.IsNotNull (ps.Certificate, "Certificate");
+                       Assert.AreEqual (sha1Name, ps.DigestAlgorithm.FriendlyName, "DigestAlgorithm.FriendlyName");
+                       Assert.AreEqual (sha1Oid, ps.DigestAlgorithm.Value, "DigestAlgorithm.Value");
+                       Assert.AreEqual (X509IncludeOption.ExcludeRoot, ps.IncludeOption, "IncludeOption");
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType, "SignerIdentifierType");
+                       Assert.AreEqual (0, ps.UnsignedAttributes.Count, "UnsignedAttributes");
                }
 
                [Test]
@@ -149,13 +149,13 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        X509Certificate2 x509 = null;
                        CmsSigner ps = new CmsSigner (x509);
                        // default properties
-                       AssertEquals ("SignedAttributes", 0, ps.SignedAttributes.Count);
-                       AssertNull ("Certificate", ps.Certificate);
-                       AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-                       AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-                       AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-                       AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-                       AssertEquals ("UnsignedAttributes", 0, ps.UnsignedAttributes.Count);
+                       Assert.AreEqual (0, ps.SignedAttributes.Count, "SignedAttributes");
+                       Assert.IsNull (ps.Certificate, "Certificate");
+                       Assert.AreEqual (sha1Name, ps.DigestAlgorithm.FriendlyName, "DigestAlgorithm.FriendlyName");
+                       Assert.AreEqual (sha1Oid, ps.DigestAlgorithm.Value, "DigestAlgorithm.Value");
+                       Assert.AreEqual (X509IncludeOption.ExcludeRoot, ps.IncludeOption, "IncludeOption");
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType, "SignerIdentifierType");
+                       Assert.AreEqual (0, ps.UnsignedAttributes.Count, "UnsignedAttributes");
                }
 
                [Test]
@@ -164,13 +164,13 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        X509Certificate2 x509 = GetValidCertificateWithPrivateKey ();
                        CmsSigner ps = new CmsSigner (SubjectIdentifierType.IssuerAndSerialNumber, x509);
                        // default properties
-                       AssertEquals ("SignedAttributes", 0, ps.SignedAttributes.Count);
-                       AssertNotNull ("Certificate", ps.Certificate);
-                       AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-                       AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-                       AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-                       AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-                       AssertEquals ("UnsignedAttributes", 0, ps.UnsignedAttributes.Count);
+                       Assert.AreEqual (0, ps.SignedAttributes.Count, "SignedAttributes");
+                       Assert.IsNotNull (ps.Certificate, "Certificate");
+                       Assert.AreEqual (sha1Name, ps.DigestAlgorithm.FriendlyName, "DigestAlgorithm.FriendlyName");
+                       Assert.AreEqual (sha1Oid, ps.DigestAlgorithm.Value, "DigestAlgorithm.Value");
+                       Assert.AreEqual (X509IncludeOption.ExcludeRoot, ps.IncludeOption, "IncludeOption");
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType, "SignerIdentifierType");
+                       Assert.AreEqual (0, ps.UnsignedAttributes.Count, "UnsignedAttributes");
                }
 
                [Test]
@@ -179,13 +179,13 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        X509Certificate2 x509 = GetValidCertificateWithPrivateKey ();
                        CmsSigner ps = new CmsSigner (SubjectIdentifierType.SubjectKeyIdentifier, x509);
                        // default properties
-                       AssertEquals ("SignedAttributes", 0, ps.SignedAttributes.Count);
-                       AssertNotNull ("Certificate", ps.Certificate);
-                       AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-                       AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-                       AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-                       AssertEquals ("SignerIdentifierType", SubjectIdentifierType.SubjectKeyIdentifier, ps.SignerIdentifierType);
-                       AssertEquals ("UnsignedAttributes", 0, ps.UnsignedAttributes.Count);
+                       Assert.AreEqual (0, ps.SignedAttributes.Count, "SignedAttributes");
+                       Assert.IsNotNull (ps.Certificate, "Certificate");
+                       Assert.AreEqual (sha1Name, ps.DigestAlgorithm.FriendlyName, "DigestAlgorithm.FriendlyName");
+                       Assert.AreEqual (sha1Oid, ps.DigestAlgorithm.Value, "DigestAlgorithm.Value");
+                       Assert.AreEqual (X509IncludeOption.ExcludeRoot, ps.IncludeOption, "IncludeOption");
+                       Assert.AreEqual (SubjectIdentifierType.SubjectKeyIdentifier, ps.SignerIdentifierType, "SignerIdentifierType");
+                       Assert.AreEqual (0, ps.UnsignedAttributes.Count, "UnsignedAttributes");
                }
 
                [Test]
@@ -194,14 +194,14 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        X509Certificate2 x509 = GetValidCertificateWithPrivateKey ();
                        CmsSigner ps = new CmsSigner (SubjectIdentifierType.Unknown, x509);
                        // default properties
-                       AssertEquals ("SignedAttributes", 0, ps.SignedAttributes.Count);
-                       AssertNotNull ("Certificate", ps.Certificate);
-                       AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-                       AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-                       AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
+                       Assert.AreEqual (0, ps.SignedAttributes.Count, "SignedAttributes");
+                       Assert.IsNotNull (ps.Certificate, "Certificate");
+                       Assert.AreEqual (sha1Name, ps.DigestAlgorithm.FriendlyName, "DigestAlgorithm.FriendlyName");
+                       Assert.AreEqual (sha1Oid, ps.DigestAlgorithm.Value, "DigestAlgorithm.Value");
+                       Assert.AreEqual (X509IncludeOption.ExcludeRoot, ps.IncludeOption, "IncludeOption");
                        // Unknown is converted to IssuerAndSerialNumber
-                       AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-                       AssertEquals ("UnsignedAttributes", 0, ps.UnsignedAttributes.Count);
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType, "SignerIdentifierType");
+                       Assert.AreEqual (0, ps.UnsignedAttributes.Count, "UnsignedAttributes");
                }
 
                [Test]
@@ -210,33 +210,33 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        CmsSigner ps = new CmsSigner (SubjectIdentifierType.IssuerAndSerialNumber, null);
                        // default properties
-                       AssertEquals ("SignedAttributes", 0, ps.SignedAttributes.Count);
-                       AssertNull ("Certificate", ps.Certificate);
-                       AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, ps.DigestAlgorithm.FriendlyName);
-                       AssertEquals ("DigestAlgorithm.Value", sha1Oid, ps.DigestAlgorithm.Value);
-                       AssertEquals ("IncludeOption", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
-                       AssertEquals ("SignerIdentifierType", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
-                       AssertEquals ("UnsignedAttributes", 0, ps.UnsignedAttributes.Count);
+                       Assert.AreEqual (0, ps.SignedAttributes.Count, "SignedAttributes");
+                       Assert.IsNull (ps.Certificate, "Certificate");
+                       Assert.AreEqual (sha1Name, ps.DigestAlgorithm.FriendlyName, "DigestAlgorithm.FriendlyName");
+                       Assert.AreEqual (sha1Oid, ps.DigestAlgorithm.Value, "DigestAlgorithm.Value");
+                       Assert.AreEqual (X509IncludeOption.ExcludeRoot, ps.IncludeOption, "IncludeOption");
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType, "SignerIdentifierType");
+                       Assert.AreEqual (0, ps.UnsignedAttributes.Count, "UnsignedAttributes");
                }
 
                [Test]
                public void SignedAttributes ()
                {
                        CmsSigner ps = new CmsSigner ();
-                       AssertEquals ("SignedAttributes=0", 0, ps.SignedAttributes.Count);
+                       Assert.AreEqual (0, ps.SignedAttributes.Count, "SignedAttributes=0");
                        ps.SignedAttributes.Add (new Pkcs9DocumentDescription ("mono"));
-                       AssertEquals ("SignedAttributes=1", 1, ps.SignedAttributes.Count);
+                       Assert.AreEqual (1, ps.SignedAttributes.Count, "SignedAttributes=1");
                }
 
                [Test]
                public void Certificate () 
                {
                        CmsSigner ps = new CmsSigner ();
-                       AssertNull ("Certificate=default(null)", ps.Certificate);
+                       Assert.IsNull (ps.Certificate, "Certificate=default(null)");
                        ps.Certificate = GetValidCertificateWithPrivateKey ();
-                       AssertNotNull ("Certificate!=null", ps.Certificate);
+                       Assert.IsNotNull (ps.Certificate, "Certificate!=null");
                        ps.Certificate = null;
-                       AssertNull ("Certificate=null", ps.Certificate);
+                       Assert.IsNull (ps.Certificate, "Certificate=null");
                }
 
                [Test]
@@ -244,10 +244,10 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        CmsSigner ps = new CmsSigner ();
                        ps.DigestAlgorithm = new Oid ("1.2.840.113549.2.5");
-                       AssertEquals ("DigestAlgorithm.FriendlyName", "md5", ps.DigestAlgorithm.FriendlyName);
-                       AssertEquals ("DigestAlgorithm.Value", "1.2.840.113549.2.5", ps.DigestAlgorithm.Value);
+                       Assert.AreEqual ("md5", ps.DigestAlgorithm.FriendlyName, "DigestAlgorithm.FriendlyName");
+                       Assert.AreEqual ("1.2.840.113549.2.5", ps.DigestAlgorithm.Value, "DigestAlgorithm.Value");
                        ps.DigestAlgorithm = null;
-                       AssertNull ("DigestAlgorithm=null", ps.DigestAlgorithm);
+                       Assert.IsNull (ps.DigestAlgorithm, "DigestAlgorithm=null");
                }
 
                [Test]
@@ -255,13 +255,13 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        CmsSigner ps = new CmsSigner ();
                        ps.IncludeOption = X509IncludeOption.EndCertOnly;
-                       AssertEquals ("EndCertOnly", X509IncludeOption.EndCertOnly, ps.IncludeOption);
+                       Assert.AreEqual (X509IncludeOption.EndCertOnly, ps.IncludeOption, "EndCertOnly");
                        ps.IncludeOption = X509IncludeOption.ExcludeRoot;
-                       AssertEquals ("ExcludeRoot", X509IncludeOption.ExcludeRoot, ps.IncludeOption);
+                       Assert.AreEqual (X509IncludeOption.ExcludeRoot, ps.IncludeOption, "ExcludeRoot");
                        ps.IncludeOption = X509IncludeOption.None;
-                       AssertEquals ("None", X509IncludeOption.None, ps.IncludeOption);
+                       Assert.AreEqual (X509IncludeOption.None, ps.IncludeOption, "None");
                        ps.IncludeOption = X509IncludeOption.WholeChain;
-                       AssertEquals ("WholeChain", X509IncludeOption.WholeChain, ps.IncludeOption);
+                       Assert.AreEqual (X509IncludeOption.WholeChain, ps.IncludeOption, "WholeChain");
                }
 
                [Test]
@@ -269,9 +269,9 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        CmsSigner ps = new CmsSigner ();
                        ps.SignerIdentifierType = SubjectIdentifierType.IssuerAndSerialNumber;
-                       AssertEquals ("IssuerAndSerialNumber", SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType);
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, ps.SignerIdentifierType, "IssuerAndSerialNumber");
                        ps.SignerIdentifierType = SubjectIdentifierType.SubjectKeyIdentifier;
-                       AssertEquals ("SubjectKeyIdentifier", SubjectIdentifierType.SubjectKeyIdentifier, ps.SignerIdentifierType);
+                       Assert.AreEqual (SubjectIdentifierType.SubjectKeyIdentifier, ps.SignerIdentifierType, "SubjectKeyIdentifier");
                }
 
                [Test]
@@ -286,9 +286,9 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                public void UnauthenticatedAttributes () 
                {
                        CmsSigner ps = new CmsSigner ();
-                       AssertEquals ("UnsignedAttributes=0", 0, ps.UnsignedAttributes.Count);
+                       Assert.AreEqual (0, ps.UnsignedAttributes.Count, "UnsignedAttributes=0");
                        ps.UnsignedAttributes.Add (new Pkcs9DocumentDescription ("mono"));
-                       AssertEquals ("UnsignedAttributes=1", 1, ps.UnsignedAttributes.Count);
+                       Assert.AreEqual (1, ps.UnsignedAttributes.Count, "UnsignedAttributes=1");
                }
        }
 }
index 4d3aba0c11197fb0ced4be0f3933560654d347a1..a7fcd8417076fa2473083c775d4be4e276d2f43f 100644 (file)
@@ -19,7 +19,7 @@ using System.Security.Cryptography.Pkcs;
 namespace MonoTests.System.Security.Cryptography.Pkcs {
 
        [TestFixture]
-       public class CryptographicAttributeTest : Assertion {
+       public class CryptographicAttributeTest {
 
                static string defaultOid = "1.2.840.113549.1.7.1";
                static string defaultName = "PKCS 7 Data";
@@ -29,9 +29,9 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        Oid o = new Oid (defaultOid);
                        CryptographicAttribute ca = new CryptographicAttribute (o);
-                       AssertEquals ("Oid.FriendlyName", defaultName, ca.Oid.FriendlyName);
-                       AssertEquals ("Oid.Value", defaultOid, ca.Oid.Value);
-                       AssertEquals ("Values", 0, ca.Values.Count);
+                       Assert.AreEqual (defaultName, ca.Oid.FriendlyName, "Oid.FriendlyName");
+                       Assert.AreEqual (defaultOid, ca.Oid.Value, "Oid.Value");
+                       Assert.AreEqual (0, ca.Values.Count, "Values");
                }
 
                [Test]
@@ -47,9 +47,9 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        Oid o = new Oid (defaultOid);
                        ArrayList al = new ArrayList ();
                        CryptographicAttribute ca = new CryptographicAttribute (o, al);
-                       AssertEquals ("Oid.FriendlyName", defaultName, ca.Oid.FriendlyName);
-                       AssertEquals ("Oid.Value", defaultOid, ca.Oid.Value);
-                       AssertEquals ("Values", 0, ca.Values.Count);
+                       Assert.AreEqual (defaultName, ca.Oid.FriendlyName, "Oid.FriendlyName");
+                       Assert.AreEqual (defaultOid, ca.Oid.Value, "Oid.Value");
+                       Assert.AreEqual (0, ca.Values.Count, "Values");
                }
 
                [Test]
@@ -75,9 +75,9 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        Oid o = new Oid (defaultOid);
                        CryptographicAttribute ca = new CryptographicAttribute (o, o);
-                       AssertEquals ("Oid.FriendlyName", defaultName, ca.Oid.FriendlyName);
-                       AssertEquals ("Oid.Value", defaultOid, ca.Oid.Value);
-                       AssertEquals ("Values", 1, ca.Values.Count);
+                       Assert.AreEqual (defaultName, ca.Oid.FriendlyName, "Oid.FriendlyName");
+                       Assert.AreEqual (defaultOid, ca.Oid.Value, "Oid.Value");
+                       Assert.AreEqual (1, ca.Values.Count, "Values");
                }
 
                [Test]
index d6febb0a5b50da19e444609328f5c47bae188a22..2706cdfb034a0e78359b1afeccaa1e9da73bcb17 100644 (file)
@@ -41,7 +41,7 @@ using System.Security.Cryptography.X509Certificates;
 namespace MonoTests.System.Security.Cryptography.Pkcs {
 
        [TestFixture]
-       public class EnvelopedCmsTest : Assertion {
+       public class EnvelopedCmsTest {
 
                static byte[] asnNull = { 0x05, 0x00 };
                static string tdesOid = "1.2.840.113549.3.7";
@@ -72,17 +72,17 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 
                private void DefaultProperties (EnvelopedCms ep, int contentLength, int version) 
                {
-                       AssertEquals ("Certificates", 0, ep.Certificates.Count);
-                       AssertEquals ("ContentEncryptionAlgorithm.KeyLength", 0, ep.ContentEncryptionAlgorithm.KeyLength);
-                       AssertEquals ("ContentEncryptionAlgorithm.Oid.FriendlyName", tdesName, ep.ContentEncryptionAlgorithm.Oid.FriendlyName);
-                       AssertEquals ("ContentEncryptionAlgorithm.Oid.Value", tdesOid, ep.ContentEncryptionAlgorithm.Oid.Value);
-                       AssertEquals ("ContentEncryptionAlgorithm.Parameters", 0, ep.ContentEncryptionAlgorithm.Parameters.Length);
-                       AssertEquals ("ContentInfo.ContentType.FriendlyName", p7DataName, ep.ContentInfo.ContentType.FriendlyName);
-                       AssertEquals ("ContentInfo.ContentType.Value", p7DataOid, ep.ContentInfo.ContentType.Value);
-                       AssertEquals ("ContentInfo.Content", contentLength, ep.ContentInfo.Content.Length);
-                       AssertEquals ("RecipientInfos", 0, ep.RecipientInfos.Count);
-                       AssertEquals ("UnprotectedAttributes", 0, ep.UnprotectedAttributes.Count);
-                       AssertEquals ("Version", version, ep.Version);
+                       Assert.AreEqual (0, ep.Certificates.Count, "Certificates");
+                       Assert.AreEqual (0, ep.ContentEncryptionAlgorithm.KeyLength, "ContentEncryptionAlgorithm.KeyLength");
+                       Assert.AreEqual (tdesName, ep.ContentEncryptionAlgorithm.Oid.FriendlyName, "ContentEncryptionAlgorithm.Oid.FriendlyName");
+                       Assert.AreEqual (tdesOid, ep.ContentEncryptionAlgorithm.Oid.Value, "ContentEncryptionAlgorithm.Oid.Value");
+                       Assert.AreEqual (0, ep.ContentEncryptionAlgorithm.Parameters.Length, "ContentEncryptionAlgorithm.Parameters");
+                       Assert.AreEqual (p7DataName, ep.ContentInfo.ContentType.FriendlyName, "ContentInfo.ContentType.FriendlyName");
+                       Assert.AreEqual (p7DataOid, ep.ContentInfo.ContentType.Value, "ContentInfo.ContentType.Value");
+                       Assert.AreEqual (contentLength, ep.ContentInfo.Content.Length, "ContentInfo.Content");
+                       Assert.AreEqual (0, ep.RecipientInfos.Count, "RecipientInfos");
+                       Assert.AreEqual (0, ep.UnprotectedAttributes.Count, "UnprotectedAttributes");
+                       Assert.AreEqual (version, ep.Version, "Version");
                }
 
                private X509Certificate2 GetCertificate (bool includePrivateKey) 
@@ -196,19 +196,19 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        EnvelopedCms ep = new EnvelopedCms ();
                        ep.Decode (encoded);
                        // properties
-                       AssertEquals ("Certificates", 0, ep.Certificates.Count);
-                       AssertEquals ("ContentEncryptionAlgorithm.KeyLength", 192, ep.ContentEncryptionAlgorithm.KeyLength);
-                       AssertEquals ("ContentEncryptionAlgorithm.Oid.FriendlyName", tdesName, ep.ContentEncryptionAlgorithm.Oid.FriendlyName);
-                       AssertEquals ("ContentEncryptionAlgorithm.Oid.Value", tdesOid, ep.ContentEncryptionAlgorithm.Oid.Value);
-                       AssertEquals ("ContentEncryptionAlgorithm.Parameters", 16, ep.ContentEncryptionAlgorithm.Parameters.Length);
-                       AssertEquals ("ContentInfo.ContentType.FriendlyName", p7DataName, ep.ContentInfo.ContentType.FriendlyName);
-                       AssertEquals ("ContentInfo.ContentType.Value", p7DataOid, ep.ContentInfo.ContentType.Value);
-                       AssertEquals ("ContentInfo.Content", 14, ep.ContentInfo.Content.Length);
-                       AssertEquals ("RecipientInfos", 1, ep.RecipientInfos.Count);
+                       Assert.AreEqual (0, ep.Certificates.Count, "Certificates");
+                       Assert.AreEqual (192, ep.ContentEncryptionAlgorithm.KeyLength, "ContentEncryptionAlgorithm.KeyLength");
+                       Assert.AreEqual (tdesName, ep.ContentEncryptionAlgorithm.Oid.FriendlyName, "ContentEncryptionAlgorithm.Oid.FriendlyName");
+                       Assert.AreEqual (tdesOid, ep.ContentEncryptionAlgorithm.Oid.Value, "ContentEncryptionAlgorithm.Oid.Value");
+                       Assert.AreEqual (16, ep.ContentEncryptionAlgorithm.Parameters.Length, "ContentEncryptionAlgorithm.Parameters");
+                       Assert.AreEqual (p7DataName, ep.ContentInfo.ContentType.FriendlyName, "ContentInfo.ContentType.FriendlyName");
+                       Assert.AreEqual (p7DataOid, ep.ContentInfo.ContentType.Value, "ContentInfo.ContentType.Value");
+                       Assert.AreEqual (14, ep.ContentInfo.Content.Length, "ContentInfo.Content");
+                       Assert.AreEqual (1, ep.RecipientInfos.Count, "RecipientInfos");
                        RecipientInfo ri = ep.RecipientInfos [0];
-                       Assert ("RecipientInfos is KeyTransRecipientInfo", (ri is KeyTransRecipientInfo));
-                       AssertEquals ("UnprotectedAttributes", 0, ep.UnprotectedAttributes.Count);
-                       AssertEquals ("Version", 0, ep.Version);
+                       Assert.IsTrue ((ri is KeyTransRecipientInfo), "RecipientInfos is KeyTransRecipientInfo");
+                       Assert.AreEqual (0, ep.UnprotectedAttributes.Count, "UnprotectedAttributes");
+                       Assert.AreEqual (0, ep.Version, "Version");
                }
 
                [Test]
@@ -240,17 +240,17 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        xc.Add (x509);
                        ep.Decrypt (xc);
                        // properties
-                       AssertEquals ("Certificates", 0, ep.Certificates.Count);
-                       AssertEquals ("ContentEncryptionAlgorithm.KeyLength", 192, ep.ContentEncryptionAlgorithm.KeyLength);
-                       AssertEquals ("ContentEncryptionAlgorithm.Oid.FriendlyName", tdesName, ep.ContentEncryptionAlgorithm.Oid.FriendlyName);
-                       AssertEquals ("ContentEncryptionAlgorithm.Oid.Value", tdesOid, ep.ContentEncryptionAlgorithm.Oid.Value);
-                       AssertEquals ("ContentEncryptionAlgorithm.Parameters", 16, ep.ContentEncryptionAlgorithm.Parameters.Length);
-                       AssertEquals ("ContentInfo.ContentType.FriendlyName", p7DataName, ep.ContentInfo.ContentType.FriendlyName);
-                       AssertEquals ("ContentInfo.ContentType.Value", p7DataOid, ep.ContentInfo.ContentType.Value);
-                       AssertEquals ("ContentInfo.Content", "05-00", BitConverter.ToString (ep.ContentInfo.Content));
-                       AssertEquals ("RecipientInfos", 1, ep.RecipientInfos.Count);
-                       AssertEquals ("UnprotectedAttributes", 0, ep.UnprotectedAttributes.Count);
-                       AssertEquals ("Version", 0, ep.Version);
+                       Assert.AreEqual (0, ep.Certificates.Count, "Certificates");
+                       Assert.AreEqual (192, ep.ContentEncryptionAlgorithm.KeyLength, "ContentEncryptionAlgorithm.KeyLength");
+                       Assert.AreEqual (tdesName, ep.ContentEncryptionAlgorithm.Oid.FriendlyName, "ContentEncryptionAlgorithm.Oid.FriendlyName");
+                       Assert.AreEqual (tdesOid, ep.ContentEncryptionAlgorithm.Oid.Value, "ContentEncryptionAlgorithm.Oid.Value");
+                       Assert.AreEqual (16, ep.ContentEncryptionAlgorithm.Parameters.Length, "ContentEncryptionAlgorithm.Parameters");
+                       Assert.AreEqual (p7DataName, ep.ContentInfo.ContentType.FriendlyName, "ContentInfo.ContentType.FriendlyName");
+                       Assert.AreEqual (p7DataOid, ep.ContentInfo.ContentType.Value, "ContentInfo.ContentType.Value");
+                       Assert.AreEqual ("05-00", BitConverter.ToString (ep.ContentInfo.Content), "ContentInfo.Content");
+                       Assert.AreEqual (1, ep.RecipientInfos.Count, "RecipientInfos");
+                       Assert.AreEqual (0, ep.UnprotectedAttributes.Count, "UnprotectedAttributes");
+                       Assert.AreEqual (0, ep.Version, "Version");
                }
 
                [Test]
@@ -304,7 +304,7 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        EnvelopedCms ep = new EnvelopedCms ();
                        ep.Decode (encoded);
                        ep.Decrypt (xc);
-                       AssertEquals ("ContentInfo.Content", "05-00", BitConverter.ToString (ep.ContentInfo.Content));
+                       Assert.AreEqual ("05-00", BitConverter.ToString (ep.ContentInfo.Content), "ContentInfo.Content");
                }
 
                [Test]
index 8e9765ad44498f26f99c8c09bc016ce852207b82..20b86b1e44275c753e43377bad8cc606597bf7a6 100644 (file)
@@ -41,7 +41,7 @@ using System.Security.Cryptography.Xml;
 namespace MonoTests.System.Security.Cryptography.Pkcs {
 
        [TestFixture]
-       public class KeyTransRecipientInfoTest : Assertion {
+       public class KeyTransRecipientInfoTest {
 
                static private byte[] issuerAndSerialNumber = { 0x30, 0x82, 0x01, 0x1C, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x03, 0xA0, 0x82, 0x01, 0x0D, 0x30, 0x82, 0x01, 0x09, 0x02, 0x01, 0x00, 0x31, 0x81, 0xD6, 0x30, 0x81, 0xD3, 0x02, 0x01, 0x00, 0x30, 0x3C, 0x30, 0x28, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1D, 0x4D, 0x6F, 0x74, 0x75, 0x73, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67, 0x69, 0x65, 0x73, 0x20, 0x69, 0x6E, 0x63, 0x2E, 0x28, 0x74, 0x65, 0x73, 0x74, 0x29, 0x02, 0x10, 0x91, 0xC4, 0x4B, 0x0D, 0xB7, 0xD8, 0x10, 0x84, 0x42, 0x26, 0x71, 0xB3, 0x97, 0xB5, 0x00, 0x97, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x81, 0x80, 0xCA, 0x4B, 0x97, 0x9C, 0xAB, 0x79, 0xC6, 0xDF, 0x6A, 0x27, 0xC7, 0x24, 0xC4, 0x5E, 0x3B, 0x31, 0xAD, 0xBC, 0x25, 0xE6, 0x38, 0x5E, 0x79, 0x26, 0x0E, 0x68, 0x46, 0x1D, 0x21, 0x81, 0x38, 0x92, 0xEC, 0xCB, 0x7C, 0x91, 0xD6, 0x09, 0x38, 0x91, 0xCE, 0x50, 0x5B, 0x70, 0x31, 0xB0, 0x9F, 0xFC, 0xE2, 0xEE, 0x45, 0xBC, 0x4B, 0xF8, 0x9A, 0xD9, 0xEE, 0xE7, 0x4A, 0x3D, 0xCD, 0x8D, 0xFF, 0x10, 0xAB, 0xC8, 0x19, 0x05, 0x54, 0x5E, 0x40, 0x7A, 0xBE, 0x2B, 0xD7, 0x22, 0x97, 0xF3, 0x23, 0xAF, 0x50, 0xF5, 0xEB, 0x43, 0x06, 0xC3, 0xFB, 0x17, 0xCA, 0xBD, 0xAD, 0x28, 0xD8, 0x10, 0x0F, 0x61, 0xCE, 0xF8, 0x25, 0x70, 0xF6, 0xC8, 0x1E, 0x7F, 0x82, 0xE5, 0x94, 0xEB, 0x11, 0xBF, 0xB8, 0x6F, 0xEE, 0x79, 0xCD, 0x63, 0xDD, 0x59, 0x8D, 0x25, 0x0E, 0x78, 0x55, 0xCE, 0x21, 0xBA, 0x13, 0x6B, 0x30, 0x2B, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01, 0x30, 0x14, 0x06, 0x08, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x03, 0x07, 0x04, 0x08, 0x8C, 0x5D, 0xC9, 0x87, 0x88, 0x9C, 0x05, 0x72, 0x80, 0x08, 0x2C, 0xAF, 0x82, 0x91, 0xEC, 0xAD, 0xC5, 0xB5 };
                static private byte[] subjectKeyIdentifier = { 0x30, 0x81, 0xF2, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x03, 0xA0, 0x81, 0xE4, 0x30, 0x81, 0xE1, 0x02, 0x01, 0x02, 0x31, 0x81, 0xAE, 0x30, 0x81, 0xAB, 0x02, 0x01, 0x02, 0x80, 0x14, 0x02, 0xE1, 0xA7, 0x32, 0x54, 0xAE, 0xFD, 0xC0, 0xA4, 0x32, 0x36, 0xF6, 0xFE, 0x23, 0x6A, 0x03, 0x72, 0x28, 0xB1, 0xF7, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x04, 0x81, 0x80, 0x4E, 0x0C, 0xA0, 0x9D, 0x79, 0xD0, 0x31, 0x12, 0x96, 0x32, 0xD5, 0x9B, 0x51, 0x49, 0xDC, 0xC5, 0xC4, 0xFB, 0xFE, 0xE8, 0x33, 0x11, 0x13, 0xBE, 0x48, 0x02, 0x5D, 0x99, 0x9D, 0xB5, 0xAC, 0x52, 0xA3, 0xE3, 0xDE, 0x1B, 0x88, 0x00, 0x7C, 0x3E, 0xD4, 0xFE, 0x93, 0x6A, 0x93, 0x03, 0x04, 0x73, 0xA9, 0x22, 0x3E, 0xD5, 0x2A, 0xEE, 0xD7, 0xFC, 0xFB, 0xB4, 0xFF, 0xD4, 0x9B, 0x32, 0x4F, 0xB3, 0x1E, 0x8E, 0xBA, 0xF7, 0xD3, 0x12, 0x07, 0x19, 0xB8, 0x28, 0x57, 0xC4, 0x54, 0x33, 0x14, 0x83, 0x77, 0xA6, 0x14, 0x00, 0xF2, 0x02, 0xA9, 0x9B, 0x45, 0xF3, 0xAB, 0x41, 0x00, 0x69, 0xE2, 0xB3, 0xD0, 0xB9, 0xA3, 0x2D, 0x9E, 0x29, 0x7F, 0xBC, 0xAE, 0x92, 0x05, 0x11, 0x5A, 0x06, 0xB7, 0x26, 0x83, 0x0A, 0x33, 0x32, 0x6E, 0x5F, 0x4A, 0x5D, 0x32, 0x2E, 0x51, 0xD4, 0xE9, 0xD5, 0x17, 0xC9, 0x30, 0x2B, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01, 0x30, 0x14, 0x06, 0x08, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x03, 0x07, 0x04, 0x08, 0x55, 0x62, 0xB4, 0x77, 0x9A, 0x99, 0x39, 0xEF, 0x80, 0x08, 0x76, 0x3A, 0x9B, 0x63, 0x46, 0x95, 0xDB, 0xFA };
@@ -57,17 +57,17 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                public void IssuerAndSerialNumber () 
                {
                        KeyTransRecipientInfo ktri = GetKeyTransRecipientInfo (issuerAndSerialNumber);
-                       AssertEquals ("EncryptedKey", "CA-4B-97-9C-AB-79-C6-DF-6A-27-C7-24-C4-5E-3B-31-AD-BC-25-E6-38-5E-79-26-0E-68-46-1D-21-81-38-92-EC-CB-7C-91-D6-09-38-91-CE-50-5B-70-31-B0-9F-FC-E2-EE-45-BC-4B-F8-9A-D9-EE-E7-4A-3D-CD-8D-FF-10-AB-C8-19-05-54-5E-40-7A-BE-2B-D7-22-97-F3-23-AF-50-F5-EB-43-06-C3-FB-17-CA-BD-AD-28-D8-10-0F-61-CE-F8-25-70-F6-C8-1E-7F-82-E5-94-EB-11-BF-B8-6F-EE-79-CD-63-DD-59-8D-25-0E-78-55-CE-21-BA-13-6B", BitConverter.ToString (ktri.EncryptedKey));
-                       AssertEquals ("KeyEncryptionAlgorithm.KeyLength", 0, ktri.KeyEncryptionAlgorithm.KeyLength);
-                       AssertEquals ("KeyEncryptionAlgorithm.Oid.FriendlyName", "RSA", ktri.KeyEncryptionAlgorithm.Oid.FriendlyName);
-                       AssertEquals ("KeyEncryptionAlgorithm.Oid.Value", "1.2.840.113549.1.1.1", ktri.KeyEncryptionAlgorithm.Oid.Value);
-                       AssertEquals ("KeyEncryptionAlgorithm.Parameters", 0, ktri.KeyEncryptionAlgorithm.Parameters.Length);
-                       AssertEquals ("RecipientIdentifier.Type", SubjectIdentifierType.IssuerAndSerialNumber, ktri.RecipientIdentifier.Type);
+                       Assert.AreEqual ("CA-4B-97-9C-AB-79-C6-DF-6A-27-C7-24-C4-5E-3B-31-AD-BC-25-E6-38-5E-79-26-0E-68-46-1D-21-81-38-92-EC-CB-7C-91-D6-09-38-91-CE-50-5B-70-31-B0-9F-FC-E2-EE-45-BC-4B-F8-9A-D9-EE-E7-4A-3D-CD-8D-FF-10-AB-C8-19-05-54-5E-40-7A-BE-2B-D7-22-97-F3-23-AF-50-F5-EB-43-06-C3-FB-17-CA-BD-AD-28-D8-10-0F-61-CE-F8-25-70-F6-C8-1E-7F-82-E5-94-EB-11-BF-B8-6F-EE-79-CD-63-DD-59-8D-25-0E-78-55-CE-21-BA-13-6B", BitConverter.ToString (ktri.EncryptedKey), "EncryptedKey");
+                       Assert.AreEqual (0, ktri.KeyEncryptionAlgorithm.KeyLength, "KeyEncryptionAlgorithm.KeyLength");
+                       Assert.AreEqual ("RSA", ktri.KeyEncryptionAlgorithm.Oid.FriendlyName, "KeyEncryptionAlgorithm.Oid.FriendlyName");
+                       Assert.AreEqual ("1.2.840.113549.1.1.1", ktri.KeyEncryptionAlgorithm.Oid.Value, "KeyEncryptionAlgorithm.Oid.Value");
+                       Assert.AreEqual (0, ktri.KeyEncryptionAlgorithm.Parameters.Length, "KeyEncryptionAlgorithm.Parameters");
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, ktri.RecipientIdentifier.Type, "RecipientIdentifier.Type");
                        X509IssuerSerial xis = (X509IssuerSerial) ktri.RecipientIdentifier.Value;
-                       AssertEquals ("RecipientIdentifier.Value.IssuerName", "CN=Motus Technologies inc.(test)", xis.IssuerName);
-                       AssertEquals ("RecipientIdentifier.Value.SerialNumber", "91C44B0DB7D81084422671B397B50097", xis.SerialNumber);
-                       AssertEquals ("Type", RecipientInfoType.KeyTransport, ktri.Type);
-                       AssertEquals ("Version", 0, ktri.Version);
+                       Assert.AreEqual ("CN=Motus Technologies inc.(test)", xis.IssuerName, "RecipientIdentifier.Value.IssuerName");
+                       Assert.AreEqual ("91C44B0DB7D81084422671B397B50097", xis.SerialNumber, "RecipientIdentifier.Value.SerialNumber");
+                       Assert.AreEqual (RecipientInfoType.KeyTransport, ktri.Type, "Type");
+                       Assert.AreEqual (0, ktri.Version, "Version");
                }
 
                [Test]
@@ -75,24 +75,24 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                public void SubjectKeyIdentifier () 
                {
                        KeyTransRecipientInfo ktri = GetKeyTransRecipientInfo (subjectKeyIdentifier);
-                       AssertEquals ("EncryptedKey", "4E-0C-A0-9D-79-D0-31-12-96-32-D5-9B-51-49-DC-C5-C4-FB-FE-E8-33-11-13-BE-48-02-5D-99-9D-B5-AC-52-A3-E3-DE-1B-88-00-7C-3E-D4-FE-93-6A-93-03-04-73-A9-22-3E-D5-2A-EE-D7-FC-FB-B4-FF-D4-9B-32-4F-B3-1E-8E-BA-F7-D3-12-07-19-B8-28-57-C4-54-33-14-83-77-A6-14-00-F2-02-A9-9B-45-F3-AB-41-00-69-E2-B3-D0-B9-A3-2D-9E-29-7F-BC-AE-92-05-11-5A-06-B7-26-83-0A-33-32-6E-5F-4A-5D-32-2E-51-D4-E9-D5-17-C9", BitConverter.ToString (ktri.EncryptedKey));
-                       AssertEquals ("KeyEncryptionAlgorithm.KeyLength", 0, ktri.KeyEncryptionAlgorithm.KeyLength);
-                       AssertEquals ("KeyEncryptionAlgorithm.Oid.FriendlyName", "RSA", ktri.KeyEncryptionAlgorithm.Oid.FriendlyName);
-                       AssertEquals ("KeyEncryptionAlgorithm.Oid.Value", "1.2.840.113549.1.1.1", ktri.KeyEncryptionAlgorithm.Oid.Value);
-                       AssertEquals ("KeyEncryptionAlgorithm.Parameters", 0, ktri.KeyEncryptionAlgorithm.Parameters.Length);
-                       AssertEquals ("RecipientIdentifier.Type", SubjectIdentifierType.SubjectKeyIdentifier, ktri.RecipientIdentifier.Type);
-                       AssertEquals ("RecipientIdentifier.Value", "02E1A73254AEFDC0A43236F6FE236A037228B1F7", (string)ktri.RecipientIdentifier.Value);
-                       AssertEquals ("Type", RecipientInfoType.KeyTransport, ktri.Type);
-                       AssertEquals ("Version", 2, ktri.Version);
+                       Assert.AreEqual ("4E-0C-A0-9D-79-D0-31-12-96-32-D5-9B-51-49-DC-C5-C4-FB-FE-E8-33-11-13-BE-48-02-5D-99-9D-B5-AC-52-A3-E3-DE-1B-88-00-7C-3E-D4-FE-93-6A-93-03-04-73-A9-22-3E-D5-2A-EE-D7-FC-FB-B4-FF-D4-9B-32-4F-B3-1E-8E-BA-F7-D3-12-07-19-B8-28-57-C4-54-33-14-83-77-A6-14-00-F2-02-A9-9B-45-F3-AB-41-00-69-E2-B3-D0-B9-A3-2D-9E-29-7F-BC-AE-92-05-11-5A-06-B7-26-83-0A-33-32-6E-5F-4A-5D-32-2E-51-D4-E9-D5-17-C9", BitConverter.ToString (ktri.EncryptedKey), "EncryptedKey");
+                       Assert.AreEqual (0, ktri.KeyEncryptionAlgorithm.KeyLength, "KeyEncryptionAlgorithm.KeyLength");
+                       Assert.AreEqual ("RSA", ktri.KeyEncryptionAlgorithm.Oid.FriendlyName, "KeyEncryptionAlgorithm.Oid.FriendlyName");
+                       Assert.AreEqual ("1.2.840.113549.1.1.1", ktri.KeyEncryptionAlgorithm.Oid.Value, "KeyEncryptionAlgorithm.Oid.Value");
+                       Assert.AreEqual (0, ktri.KeyEncryptionAlgorithm.Parameters.Length, "KeyEncryptionAlgorithm.Parameters");
+                       Assert.AreEqual (SubjectIdentifierType.SubjectKeyIdentifier, ktri.RecipientIdentifier.Type, "RecipientIdentifier.Type");
+                       Assert.AreEqual ("02E1A73254AEFDC0A43236F6FE236A037228B1F7", (string)ktri.RecipientIdentifier.Value, "RecipientIdentifier.Value");
+                       Assert.AreEqual (RecipientInfoType.KeyTransport, ktri.Type, "Type");
+                       Assert.AreEqual (2, ktri.Version, "Version");
                }
 
                [Test]
                public void EncryptedKey_ModifyContent ()
                {
                        KeyTransRecipientInfo ktri = GetKeyTransRecipientInfo (issuerAndSerialNumber);
-                       AssertEquals ("EncryptedKey", "CA-4B-97-9C-AB-79-C6-DF-6A-27-C7-24-C4-5E-3B-31-AD-BC-25-E6-38-5E-79-26-0E-68-46-1D-21-81-38-92-EC-CB-7C-91-D6-09-38-91-CE-50-5B-70-31-B0-9F-FC-E2-EE-45-BC-4B-F8-9A-D9-EE-E7-4A-3D-CD-8D-FF-10-AB-C8-19-05-54-5E-40-7A-BE-2B-D7-22-97-F3-23-AF-50-F5-EB-43-06-C3-FB-17-CA-BD-AD-28-D8-10-0F-61-CE-F8-25-70-F6-C8-1E-7F-82-E5-94-EB-11-BF-B8-6F-EE-79-CD-63-DD-59-8D-25-0E-78-55-CE-21-BA-13-6B", BitConverter.ToString (ktri.EncryptedKey));
+                       Assert.AreEqual ("CA-4B-97-9C-AB-79-C6-DF-6A-27-C7-24-C4-5E-3B-31-AD-BC-25-E6-38-5E-79-26-0E-68-46-1D-21-81-38-92-EC-CB-7C-91-D6-09-38-91-CE-50-5B-70-31-B0-9F-FC-E2-EE-45-BC-4B-F8-9A-D9-EE-E7-4A-3D-CD-8D-FF-10-AB-C8-19-05-54-5E-40-7A-BE-2B-D7-22-97-F3-23-AF-50-F5-EB-43-06-C3-FB-17-CA-BD-AD-28-D8-10-0F-61-CE-F8-25-70-F6-C8-1E-7F-82-E5-94-EB-11-BF-B8-6F-EE-79-CD-63-DD-59-8D-25-0E-78-55-CE-21-BA-13-6B", BitConverter.ToString (ktri.EncryptedKey), "EncryptedKey");
                        ktri.EncryptedKey[0] = 0x00;
-                       AssertEquals ("EncryptedKey", "00-4B-97-9C-AB-79-C6-DF-6A-27-C7-24-C4-5E-3B-31-AD-BC-25-E6-38-5E-79-26-0E-68-46-1D-21-81-38-92-EC-CB-7C-91-D6-09-38-91-CE-50-5B-70-31-B0-9F-FC-E2-EE-45-BC-4B-F8-9A-D9-EE-E7-4A-3D-CD-8D-FF-10-AB-C8-19-05-54-5E-40-7A-BE-2B-D7-22-97-F3-23-AF-50-F5-EB-43-06-C3-FB-17-CA-BD-AD-28-D8-10-0F-61-CE-F8-25-70-F6-C8-1E-7F-82-E5-94-EB-11-BF-B8-6F-EE-79-CD-63-DD-59-8D-25-0E-78-55-CE-21-BA-13-6B", BitConverter.ToString (ktri.EncryptedKey));
+                       Assert.AreEqual ("00-4B-97-9C-AB-79-C6-DF-6A-27-C7-24-C4-5E-3B-31-AD-BC-25-E6-38-5E-79-26-0E-68-46-1D-21-81-38-92-EC-CB-7C-91-D6-09-38-91-CE-50-5B-70-31-B0-9F-FC-E2-EE-45-BC-4B-F8-9A-D9-EE-E7-4A-3D-CD-8D-FF-10-AB-C8-19-05-54-5E-40-7A-BE-2B-D7-22-97-F3-23-AF-50-F5-EB-43-06-C3-FB-17-CA-BD-AD-28-D8-10-0F-61-CE-F8-25-70-F6-C8-1E-7F-82-E5-94-EB-11-BF-B8-6F-EE-79-CD-63-DD-59-8D-25-0E-78-55-CE-21-BA-13-6B", BitConverter.ToString (ktri.EncryptedKey), "EncryptedKey");
                        // this is a reference (not a copy) of the key
                }
        }
index 7a3594bcc132f2253c9e9f34987d1ed0b60c2b60..dadcd67219f4eb493918e6e07beeac13bcbbfb79 100644 (file)
@@ -41,7 +41,7 @@ using System.Security.Cryptography.X509Certificates;
 namespace MonoTests.System.Security.Cryptography.Pkcs {
 
        [TestFixture]
-       public class SignedCmsTest : Assertion {
+       public class SignedCmsTest {
 
                static byte[] asnNull = { 0x05, 0x00 };
                static string pkcs7Oid = "1.2.840.113549.1.7.1";
@@ -87,9 +87,9 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                private void DefaultProperties (SignedCms sp, int version) 
                {
                        // unaffected by constructors
-                       AssertEquals ("Certificates", 0, sp.Certificates.Count);
-                       AssertEquals ("SignerInfos", 0, sp.SignerInfos.Count);
-                       AssertEquals ("Version", version, sp.Version);
+                       Assert.AreEqual (0, sp.Certificates.Count, "Certificates");
+                       Assert.AreEqual (0, sp.SignerInfos.Count, "SignerInfos");
+                       Assert.AreEqual (version, sp.Version, "Version");
                }
 
                private X509Certificate2 GetCertificate (bool includePrivateKey) 
@@ -108,10 +108,10 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        SignedCms sp = new SignedCms ();
                        // default properties
-                       AssertEquals ("ContentInfo.ContentType.FriendlyName", pkcs7Name, sp.ContentInfo.ContentType.FriendlyName);
-                       AssertEquals ("ContentInfo.ContentType.Value", pkcs7Oid, sp.ContentInfo.ContentType.Value);
-                       AssertEquals ("ContentInfo.Content", 0, sp.ContentInfo.Content.Length);
-                       Assert ("Detached", !sp.Detached);
+                       Assert.AreEqual (pkcs7Name, sp.ContentInfo.ContentType.FriendlyName, "ContentInfo.ContentType.FriendlyName");
+                       Assert.AreEqual (pkcs7Oid, sp.ContentInfo.ContentType.Value, "ContentInfo.ContentType.Value");
+                       Assert.AreEqual (0, sp.ContentInfo.Content.Length, "ContentInfo.Content");
+                       Assert.IsTrue (!sp.Detached, "Detached");
                        DefaultProperties (sp, 0);
                }
 
@@ -122,10 +122,10 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        ContentInfo ci = new ContentInfo (oid, asnNull);
                        SignedCms sp = new SignedCms (ci);
                        // default properties
-                       AssertEquals ("ContentInfo.ContentType.FriendlyName", rsaName, sp.ContentInfo.ContentType.FriendlyName);
-                       AssertEquals ("ContentInfo.ContentType.Value", rsaOid, sp.ContentInfo.ContentType.Value);
-                       AssertEquals ("ContentInfo.Content", 2, sp.ContentInfo.Content.Length);
-                       Assert ("Detached", !sp.Detached);
+                       Assert.AreEqual (rsaName, sp.ContentInfo.ContentType.FriendlyName, "ContentInfo.ContentType.FriendlyName");
+                       Assert.AreEqual (rsaOid, sp.ContentInfo.ContentType.Value, "ContentInfo.ContentType.Value");
+                       Assert.AreEqual (2, sp.ContentInfo.Content.Length, "ContentInfo.Content");
+                       Assert.IsTrue (!sp.Detached, "Detached");
                        DefaultProperties (sp, 0);
                }
 
@@ -143,10 +143,10 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        ContentInfo ci = new ContentInfo (oid, asnNull);
                        SignedCms sp = new SignedCms (ci, true);
                        // default properties
-                       AssertEquals ("ContentInfo.ContentType.FriendlyName", rsaName, sp.ContentInfo.ContentType.FriendlyName);
-                       AssertEquals ("ContentInfo.ContentType.Value", rsaOid, sp.ContentInfo.ContentType.Value);
-                       AssertEquals ("ContentInfo.Content", 2, sp.ContentInfo.Content.Length);
-                       Assert ("Detached", sp.Detached);
+                       Assert.AreEqual (rsaName, sp.ContentInfo.ContentType.FriendlyName, "ContentInfo.ContentType.FriendlyName");
+                       Assert.AreEqual (rsaOid, sp.ContentInfo.ContentType.Value, "ContentInfo.ContentType.Value");
+                       Assert.AreEqual (2, sp.ContentInfo.Content.Length, "ContentInfo.Content");
+                       Assert.IsTrue (sp.Detached, "Detached");
                        DefaultProperties (sp, 0);
                }
 
@@ -157,10 +157,10 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        ContentInfo ci = new ContentInfo (oid, asnNull);
                        SignedCms sp = new SignedCms (ci, false);
                        // default properties
-                       AssertEquals ("ContentInfo.ContentType.FriendlyName", rsaName, sp.ContentInfo.ContentType.FriendlyName);
-                       AssertEquals ("ContentInfo.ContentType.Value", rsaOid, sp.ContentInfo.ContentType.Value);
-                       AssertEquals ("ContentInfo.Content", 2, sp.ContentInfo.Content.Length);
-                       Assert ("Detached", !sp.Detached);
+                       Assert.AreEqual (rsaName, sp.ContentInfo.ContentType.FriendlyName, "ContentInfo.ContentType.FriendlyName");
+                       Assert.AreEqual (rsaOid, sp.ContentInfo.ContentType.Value, "ContentInfo.ContentType.Value");
+                       Assert.AreEqual (2, sp.ContentInfo.Content.Length, "ContentInfo.Content");
+                       Assert.IsTrue (!sp.Detached, "Detached");
                }
 
                [Test]
@@ -172,10 +172,10 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 
                private void DefaultSubjectIdentifierTypePropertiesCms (SignedCms sp, int version) 
                {
-                       AssertEquals ("ContentInfo.ContentType.FriendlyName", pkcs7Name, sp.ContentInfo.ContentType.FriendlyName);
-                       AssertEquals ("ContentInfo.ContentType.Value", pkcs7Oid, sp.ContentInfo.ContentType.Value);
-                       AssertEquals ("ContentInfo.Content", 0, sp.ContentInfo.Content.Length);
-                       Assert ("Detached", !sp.Detached);
+                       Assert.AreEqual (pkcs7Name, sp.ContentInfo.ContentType.FriendlyName, "ContentInfo.ContentType.FriendlyName");
+                       Assert.AreEqual (pkcs7Oid, sp.ContentInfo.ContentType.Value, "ContentInfo.ContentType.Value");
+                       Assert.AreEqual (0, sp.ContentInfo.Content.Length, "ContentInfo.Content");
+                       Assert.IsTrue (!sp.Detached, "Detached");
                        DefaultProperties (sp, version);
                }
 
@@ -205,9 +205,9 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 
                private void DefaultSubjectIdentifierTypeProperties (SignedCms sp, int version) 
                {
-                       AssertEquals ("ContentInfo.ContentType.FriendlyName", rsaName, sp.ContentInfo.ContentType.FriendlyName);
-                       AssertEquals ("ContentInfo.ContentType.Value", rsaOid, sp.ContentInfo.ContentType.Value);
-                       AssertEquals ("ContentInfo.Content", 2, sp.ContentInfo.Content.Length);
+                       Assert.AreEqual (rsaName, sp.ContentInfo.ContentType.FriendlyName, "ContentInfo.ContentType.FriendlyName");
+                       Assert.AreEqual (rsaOid, sp.ContentInfo.ContentType.Value, "ContentInfo.ContentType.Value");
+                       Assert.AreEqual (2, sp.ContentInfo.Content.Length, "ContentInfo.Content");
                        DefaultProperties (sp, version);
                }
 
@@ -218,7 +218,7 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        ContentInfo ci = new ContentInfo (oid, asnNull);
                        SignedCms sp = new SignedCms (SubjectIdentifierType.IssuerAndSerialNumber, ci);
                        // default properties
-                       Assert ("Detached", !sp.Detached);
+                       Assert.IsTrue (!sp.Detached, "Detached");
                        DefaultSubjectIdentifierTypeProperties (sp, 0);
                }
 
@@ -229,7 +229,7 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        ContentInfo ci = new ContentInfo (oid, asnNull);
                        SignedCms sp = new SignedCms (SubjectIdentifierType.SubjectKeyIdentifier, ci);
                        // default properties
-                       Assert ("Detached", !sp.Detached);
+                       Assert.IsTrue (!sp.Detached, "Detached");
                        DefaultSubjectIdentifierTypeProperties (sp, 0);
                }
 
@@ -240,7 +240,7 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        ContentInfo ci = new ContentInfo (oid, asnNull);
                        SignedCms sp = new SignedCms (SubjectIdentifierType.Unknown, ci);
                        // default properties
-                       Assert ("Detached", !sp.Detached);
+                       Assert.IsTrue (!sp.Detached, "Detached");
                        DefaultSubjectIdentifierTypeProperties (sp, 0);
                }
 
@@ -258,7 +258,7 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        ContentInfo ci = new ContentInfo (oid, asnNull);
                        SignedCms sp = new SignedCms (SubjectIdentifierType.IssuerAndSerialNumber, ci, true);
                        // default properties
-                       Assert ("Detached", sp.Detached);
+                       Assert.IsTrue (sp.Detached, "Detached");
                        DefaultSubjectIdentifierTypeProperties (sp, 0);
                }
 
@@ -269,7 +269,7 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        ContentInfo ci = new ContentInfo (oid, asnNull);
                        SignedCms sp = new SignedCms (SubjectIdentifierType.SubjectKeyIdentifier, ci, true);
                        // default properties
-                       Assert ("Detached", sp.Detached);
+                       Assert.IsTrue (sp.Detached, "Detached");
                        DefaultSubjectIdentifierTypeProperties (sp, 0);
                }
 
@@ -280,7 +280,7 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                        ContentInfo ci = new ContentInfo (oid, asnNull);
                        SignedCms sp = new SignedCms (SubjectIdentifierType.Unknown, ci, true);
                        // default properties
-                       Assert ("Detached", sp.Detached);
+                       Assert.IsTrue (sp.Detached, "Detached");
                        DefaultSubjectIdentifierTypeProperties (sp, 0);
                }
 
@@ -383,11 +383,11 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
 
                private void CheckSignatureProperties (SignedCms sp, int version) 
                {
-                       AssertEquals ("Certificates", 1, sp.Certificates.Count);
-                       AssertEquals ("ContentInfo.Content", 2, sp.ContentInfo.Content.Length);
-                       Assert ("Detached", !sp.Detached);
-                       AssertEquals ("SignerInfos", 1, sp.SignerInfos.Count);
-                       AssertEquals ("Version", version, sp.Version);
+                       Assert.AreEqual (1, sp.Certificates.Count, "Certificates");
+                       Assert.AreEqual (2, sp.ContentInfo.Content.Length, "ContentInfo.Content");
+                       Assert.IsTrue (!sp.Detached, "Detached");
+                       Assert.AreEqual (1, sp.SignerInfos.Count, "SignerInfos");
+                       Assert.AreEqual (version, sp.Version, "Version");
                }
 
                [Test]
index 689f52b6e0b2e73f7e3d71d27c953501e26a481f..96e0d58f5e4a20603ce2e70a0ffeab7fdf404c3b 100644 (file)
@@ -41,7 +41,7 @@ using System.Security.Cryptography.Xml;
 namespace MonoTests.System.Security.Cryptography.Pkcs {
 
        [TestFixture]
-       public class SignerInfoTest : Assertion {
+       public class SignerInfoTest {
 
                static byte[] asnNull = { 0x05, 0x00 };
                static string sha1Oid = "1.3.14.3.2.26";
@@ -75,15 +75,15 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        SignerInfo si = GetSignerInfo (issuerAndSerialNumberSignature);
                        // default properties
-                       AssertEquals ("SignedAttributes", 0, si.SignedAttributes.Count);
-                       AssertNotNull ("Certificate", si.Certificate);
-                       AssertEquals ("CounterSignerInfos", 0, si.CounterSignerInfos.Count);
-                       AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, si.DigestAlgorithm.FriendlyName);
-                       AssertEquals ("DigestAlgorithm.Value", sha1Oid, si.DigestAlgorithm.Value);
-                       AssertEquals ("SignerIdentifier.Type", SubjectIdentifierType.IssuerAndSerialNumber, si.SignerIdentifier.Type);
-                       Assert ("SignerIdentifier.Value", (si.SignerIdentifier.Value.GetType () == typeof (X509IssuerSerial)));
-                       AssertEquals ("UnsignedAttributes", 0, si.UnsignedAttributes.Count);
-                       AssertEquals ("Version", 1, si.Version);
+                       Assert.AreEqual (0, si.SignedAttributes.Count, "SignedAttributes");
+                       Assert.IsNotNull (si.Certificate, "Certificate");
+                       Assert.AreEqual (0, si.CounterSignerInfos.Count, "CounterSignerInfos");
+                       Assert.AreEqual (sha1Name, si.DigestAlgorithm.FriendlyName, "DigestAlgorithm.FriendlyName");
+                       Assert.AreEqual (sha1Oid, si.DigestAlgorithm.Value, "DigestAlgorithm.Value");
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, si.SignerIdentifier.Type, "SignerIdentifier.Type");
+                       Assert.IsTrue ((si.SignerIdentifier.Value.GetType () == typeof (X509IssuerSerial)), "SignerIdentifier.Value");
+                       Assert.AreEqual (0, si.UnsignedAttributes.Count, "UnsignedAttributes");
+                       Assert.AreEqual (1, si.Version, "Version");
                }
 
                [Test]
@@ -91,15 +91,15 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                {
                        SignerInfo si = GetSignerInfo (subjectKeyIdentifierSignature);
                        // default properties
-                       AssertEquals ("SignedAttributes", 0, si.SignedAttributes.Count);
-                       AssertNotNull ("Certificate", si.Certificate);
-                       AssertEquals ("CounterSignerInfos", 0, si.CounterSignerInfos.Count);
-                       AssertEquals ("DigestAlgorithm.FriendlyName", sha1Name, si.DigestAlgorithm.FriendlyName);
-                       AssertEquals ("DigestAlgorithm.Value", sha1Oid, si.DigestAlgorithm.Value);
-                       AssertEquals ("SignerIdentifier.Type", SubjectIdentifierType.SubjectKeyIdentifier, si.SignerIdentifier.Type);
-                       AssertEquals ("SignerIdentifier.Value", "02E1A73254AEFDC0A43236F6FE236A037228B1F7", (string)si.SignerIdentifier.Value);
-                       AssertEquals ("UnsignedAttributes", 0, si.UnsignedAttributes.Count);
-                       AssertEquals ("Version", 3, si.Version);
+                       Assert.AreEqual (0, si.SignedAttributes.Count, "SignedAttributes");
+                       Assert.IsNotNull (si.Certificate, "Certificate");
+                       Assert.AreEqual (0, si.CounterSignerInfos.Count, "CounterSignerInfos");
+                       Assert.AreEqual (sha1Name, si.DigestAlgorithm.FriendlyName, "DigestAlgorithm.FriendlyName");
+                       Assert.AreEqual (sha1Oid, si.DigestAlgorithm.Value, "DigestAlgorithm.Value");
+                       Assert.AreEqual (SubjectIdentifierType.SubjectKeyIdentifier, si.SignerIdentifier.Type, "SignerIdentifier.Type");
+                       Assert.AreEqual ("02E1A73254AEFDC0A43236F6FE236A037228B1F7", (string)si.SignerIdentifier.Value, "SignerIdentifier.Value");
+                       Assert.AreEqual (0, si.UnsignedAttributes.Count, "UnsignedAttributes");
+                       Assert.AreEqual (3, si.Version, "Version");
                }
        }
 }
index 8400f3bffd39524f77ff54954b3953f05365eb80..9a8f1a50f9dea3bd4ee82c6c4a1845fe90703c39 100644 (file)
@@ -41,7 +41,7 @@ using System.Security.Cryptography.Xml;
 namespace MonoTests.System.Security.Cryptography.Pkcs {
 
        [TestFixture]
-       public class SubjectIdentifierTest : Assertion {
+       public class SubjectIdentifierTest {
 
                static byte[] issuerAndSerialNumberSignature = { 0x30, 0x82, 0x03, 0x4C, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x02, 0xA0, 0x82, 0x03, 0x3D, 0x30, 0x82, 0x03, 0x39, 0x02, 0x01, 0x01, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x30, 0x11, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01, 0xA0, 0x04, 0x04, 0x02, 0x05, 0x00, 0xA0, 0x82, 0x02, 0x2E, 0x30, 0x82, 0x02, 0x2A, 0x30, 0x82, 0x01, 0x97, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x10, 0x91, 0xC4, 0x4B, 0x0D, 0xB7, 0xD8, 0x10, 0x84, 0x42, 0x26, 0x71, 0xB3, 0x97, 0xB5, 0x00, 0x97, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1D, 0x05, 0x00, 0x30, 0x28, 0x31, 0x26, 0x30, 0x24, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x1D, 0x4D, 0x6F, 0x74, 0x75, 0x73, 0x20, 0x54, 0x65,
                        0x63, 0x68, 0x6E, 0x6F, 0x6C, 0x6F, 0x67, 0x69, 0x65, 0x73, 0x20, 0x69, 0x6E, 0x63, 0x2E, 0x28, 0x74, 0x65, 0x73, 0x74, 0x29, 0x30, 0x1E, 0x17, 0x0D, 0x30, 0x33, 0x30, 0x38, 0x31, 0x33, 0x30, 0x30, 0x34, 0x33, 0x34, 0x37, 0x5A, 0x17, 0x0D, 0x33, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5A, 0x30, 0x13, 0x31, 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x08, 0x46, 0x41, 0x52, 0x53, 0x43, 0x41, 0x50, 0x45, 0x30, 0x81, 0x9F, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81, 0x8D, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xD2, 0xCB, 0x47, 0x21, 0xF5, 0x62, 0xDD, 0x35, 0xBF, 0x1D, 0xEC, 0x9A, 0x4C, 0x07, 0x2C, 0x01, 0xF0, 0x28, 0xC2, 0x82, 0x17, 0x8E, 0x58, 0x32, 
@@ -70,19 +70,19 @@ namespace MonoTests.System.Security.Cryptography.Pkcs {
                public void IssuerAndSerialNumber () 
                {
                        SubjectIdentifier si = GetSubjectIdentifier (issuerAndSerialNumberSignature);
-                       AssertEquals ("SignerIdentifier.Type", SubjectIdentifierType.IssuerAndSerialNumber, si.Type);
-                       Assert ("SignerIdentifier.Value", (si.Value.GetType () == typeof (X509IssuerSerial)));
+                       Assert.AreEqual (SubjectIdentifierType.IssuerAndSerialNumber, si.Type, "SignerIdentifier.Type");
+                       Assert.IsTrue ((si.Value.GetType () == typeof (X509IssuerSerial)), "SignerIdentifier.Value");
                        X509IssuerSerial xis = (X509IssuerSerial) si.Value;
-                       AssertEquals ("X509IssuerSerial.IssuerName", "CN=Motus Technologies inc.(test)", xis.IssuerName);
-                       AssertEquals ("X509IssuerSerial.SerialNumber", "91C44B0DB7D81084422671B397B50097", xis.SerialNumber);
+                       Assert.AreEqual ("CN=Motus Technologies inc.(test)", xis.IssuerName, "X509IssuerSerial.IssuerName");
+                       Assert.AreEqual ("91C44B0DB7D81084422671B397B50097", xis.SerialNumber, "X509IssuerSerial.SerialNumber");
                }
 
                [Test]
                public void SubjectKeyIdentifier () 
                {
                        SubjectIdentifier si = GetSubjectIdentifier (subjectKeyIdentifierSignature);
-                       AssertEquals ("Type", SubjectIdentifierType.SubjectKeyIdentifier, si.Type);
-                       AssertEquals ("SignerIdentifier.Value", "02E1A73254AEFDC0A43236F6FE236A037228B1F7", (string)si.Value);
+                       Assert.AreEqual (SubjectIdentifierType.SubjectKeyIdentifier, si.Type, "Type");
+                       Assert.AreEqual ("02E1A73254AEFDC0A43236F6FE236A037228B1F7", (string)si.Value, "SignerIdentifier.Value");
                }
        }
 }