| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- //
- // HybridDictionaryTest.cs - NUnit Test Cases for System.Net.HybridDictionary
- //
- // Authors:
- // Lawrence Pit ([email protected])
- // Martin Willemoes Hansen ([email protected])
- //
- // (C) 2003 Martin Willemoes Hansen
- //
- using NUnit.Framework;
- using System;
- using System.Collections;
- using System.Collections.Specialized;
- namespace MonoTests.System.Collections.Specialized
- {
- [TestFixture]
- public class HybridDictionaryTest : Assertion
- {
- [Test]
- public void All ()
- {
- HybridDictionary dict = new HybridDictionary (true);
- dict.Add ("CCC", "ccc");
- dict.Add ("BBB", "bbb");
- dict.Add ("fff", "fff");
- dict ["EEE"] = "eee";
- dict ["ddd"] = "ddd";
-
- Assertion.AssertEquals ("#1", 5, dict.Count);
- Assertion.AssertEquals ("#2", "eee", dict ["eee"]);
-
- dict.Add ("CCC2", "ccc");
- dict.Add ("BBB2", "bbb");
- dict.Add ("fff2", "fff");
- dict ["EEE2"] = "eee";
- dict ["ddd2"] = "ddd";
- dict ["xxx"] = "xxx";
- dict ["yyy"] = "yyy";
-
- Assertion.AssertEquals ("#3", 12, dict.Count);
- Assertion.AssertEquals ("#4", "eee", dict ["eee"]);
- }
- [Test]
- public void Empty ()
- {
- HybridDictionary hd = new HybridDictionary (true);
- Assert ("null", !hd.Contains (null));
- Assert ("unexisting", !hd.Contains ("unexisting"));
- }
- [Test]
- [ExpectedException (typeof (ArgumentNullException))]
- public void NotEmpty ()
- {
- HybridDictionary hd = new HybridDictionary (true);
- hd.Add ("CCC", "ccc");
- AssertEquals ("Count", 1, hd.Count);
- Assert ("null", !hd.Contains (null));
- }
- }
- }
|