2 // OidCollectionTest.cs - NUnit tests for OidCollection
5 // Sebastien Pouliot (spouliot@motus.com)
7 // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
12 using NUnit.Framework;
15 using System.Security.Cryptography;
17 namespace MonoTests.System.Security.Cryptography {
21 [Ignore ("The class System.Security.Cryptography.OidCollection - is not supported")]
23 public class OidCollectionTest : Assertion {
27 public void Constructor ()
29 OidCollection oc = new OidCollection ();
31 AssertEquals ("Count", 0, oc.Count);
32 Assert ("IsSynchronized", !oc.IsSynchronized);
33 AssertNotNull ("SyncRoot", oc.SyncRoot);
34 AssertNotNull ("GetEnumerator", oc.GetEnumerator ());
40 OidCollection oc = new OidCollection ();
41 oc.Add (new Oid ("1.0"));
42 AssertEquals ("Count", 1, oc.Count);
43 AssertEquals ("[0]", "1.0", oc [0].Value);
44 AssertEquals ("['1.0']", "1.0", oc ["1.0"].Value);
48 //BUG [ExpectedException (typeof (ArgumentNullException))]
49 public void AddNull ()
51 OidCollection oc = new OidCollection ();
53 AssertEquals ("Count", 1, oc.Count);
54 // AssertNull ("[0]", oc); throw NullReferenceException
58 public void CopyToOid ()
60 OidCollection oc = new OidCollection ();
61 oc.Add (new Oid ("1.0"));
62 Oid[] array = new Oid [1];
64 AssertEquals ("CopyTo(Oid)", "1.0", array [0].Value);
68 [ExpectedException (typeof (ArgumentNullException))]
69 public void CopyToOidNull ()
71 OidCollection oc = new OidCollection ();
72 oc.Add (new Oid ("1.0"));