(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / System.Security / Test / System.Security.Cryptography / OidCollectionTest.cs
blobda0e7066ba9c299533019231dc4c2e9201126188
1 //
2 // OidCollectionTest.cs - NUnit tests for OidCollection
3 //
4 // Author:
5 // Sebastien Pouliot (spouliot@motus.com)
6 //
7 // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
8 //
10 #if NET_2_0
12 using NUnit.Framework;
14 using System;
15 using System.Security.Cryptography;
17 namespace MonoTests.System.Security.Cryptography {
19 [TestFixture]
20 public class OidCollectionTest : Assertion {
22 [Test]
23 public void Constructor ()
25 OidCollection oc = new OidCollection ();
26 // default properties
27 AssertEquals ("Count", 0, oc.Count);
28 Assert ("IsSynchronized", !oc.IsSynchronized);
29 AssertNotNull ("SyncRoot", oc.SyncRoot);
30 AssertNotNull ("GetEnumerator", oc.GetEnumerator ());
33 [Test]
34 public void Add ()
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);
43 [Test]
44 //BUG [ExpectedException (typeof (ArgumentNullException))]
45 public void AddNull ()
47 OidCollection oc = new OidCollection ();
48 oc.Add (null);
49 AssertEquals ("Count", 1, oc.Count);
50 // AssertNull ("[0]", oc); throw NullReferenceException
53 [Test]
54 public void CopyToOid ()
56 OidCollection oc = new OidCollection ();
57 oc.Add (new Oid ("1.0"));
58 Oid[] array = new Oid [1];
59 oc.CopyTo (array, 0);
60 AssertEquals ("CopyTo(Oid)", "1.0", array [0].Value);
63 [Test]
64 [ExpectedException (typeof (ArgumentNullException))]
65 public void CopyToOidNull ()
67 OidCollection oc = new OidCollection ();
68 oc.Add (new Oid ("1.0"));
69 Oid[] array = null;
70 oc.CopyTo (array, 0);
75 #endif