mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 03:51:19 -10:00
Renamed the `NET_1_2' conditional to `NET_2_0' in all files. svn path=/trunk/mcs/; revision=25877
76 lines
1.6 KiB
C#
Executable File
76 lines
1.6 KiB
C#
Executable File
//
|
|
// OidCollectionTest.cs - NUnit tests for OidCollection
|
|
//
|
|
// Author:
|
|
// Sebastien Pouliot ([email protected])
|
|
//
|
|
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
|
|
//
|
|
|
|
#if NET_2_0
|
|
|
|
using NUnit.Framework;
|
|
|
|
using System;
|
|
using System.Security.Cryptography;
|
|
|
|
namespace MonoTests.System.Security.Cryptography {
|
|
|
|
[TestFixture]
|
|
public class OidCollectionTest : Assertion {
|
|
|
|
[Test]
|
|
public void Constructor ()
|
|
{
|
|
OidCollection oc = new OidCollection ();
|
|
// default properties
|
|
AssertEquals ("Count", 0, oc.Count);
|
|
Assert ("IsSynchronized", !oc.IsSynchronized);
|
|
AssertNotNull ("SyncRoot", oc.SyncRoot);
|
|
AssertNotNull ("GetEnumerator", oc.GetEnumerator ());
|
|
}
|
|
|
|
[Test]
|
|
public void Add ()
|
|
{
|
|
OidCollection oc = new OidCollection ();
|
|
oc.Add (new Oid ("1.0"));
|
|
AssertEquals ("Count", 1, oc.Count);
|
|
AssertEquals ("[0]", "1.0", oc [0].Value);
|
|
AssertEquals ("['1.0']", "1.0", oc ["1.0"].Value);
|
|
}
|
|
|
|
[Test]
|
|
//BUG [ExpectedException (typeof (ArgumentNullException))]
|
|
public void AddNull ()
|
|
{
|
|
OidCollection oc = new OidCollection ();
|
|
oc.Add (null);
|
|
AssertEquals ("Count", 1, oc.Count);
|
|
// AssertNull ("[0]", oc); throw NullReferenceException
|
|
}
|
|
|
|
[Test]
|
|
public void CopyToOid ()
|
|
{
|
|
OidCollection oc = new OidCollection ();
|
|
oc.Add (new Oid ("1.0"));
|
|
Oid[] array = new Oid [1];
|
|
oc.CopyTo (array, 0);
|
|
AssertEquals ("CopyTo(Oid)", "1.0", array [0].Value);
|
|
}
|
|
|
|
[Test]
|
|
[ExpectedException (typeof (ArgumentNullException))]
|
|
public void CopyToOidNull ()
|
|
{
|
|
OidCollection oc = new OidCollection ();
|
|
oc.Add (new Oid ("1.0"));
|
|
Oid[] array = null;
|
|
oc.CopyTo (array, 0);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif
|