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
{
20 public class OidCollectionTest
: Assertion
{
23 public void Constructor ()
25 OidCollection oc
= new OidCollection ();
27 AssertEquals ("Count", 0, oc
.Count
);
28 Assert ("IsSynchronized", !oc
.IsSynchronized
);
29 AssertNotNull ("SyncRoot", oc
.SyncRoot
);
30 AssertNotNull ("GetEnumerator", oc
.GetEnumerator ());
36 OidCollection oc
= new OidCollection ();
37 oc
.Add (new Oid ("1.0"));
38 AssertEquals ("Count", 1, oc
.Count
);
39 AssertEquals ("[0]", "1.0", oc
[0].Value
);
40 AssertEquals ("['1.0']", "1.0", oc
["1.0"].Value
);
44 //BUG [ExpectedException (typeof (ArgumentNullException))]
45 public void AddNull ()
47 OidCollection oc
= new OidCollection ();
49 AssertEquals ("Count", 1, oc
.Count
);
50 // AssertNull ("[0]", oc); throw NullReferenceException
54 public void CopyToOid ()
56 OidCollection oc
= new OidCollection ();
57 oc
.Add (new Oid ("1.0"));
58 Oid
[] array
= new Oid
[1];
60 AssertEquals ("CopyTo(Oid)", "1.0", array
[0].Value
);
64 [ExpectedException (typeof (ArgumentNullException
))]
65 public void CopyToOidNull ()
67 OidCollection oc
= new OidCollection ();
68 oc
.Add (new Oid ("1.0"));