HybridDictionaryTest.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // HybridDictionaryTest.cs - NUnit Test Cases for System.Net.HybridDictionary
  3. //
  4. // Author:
  5. // Lawrence Pit ([email protected])
  6. //
  7. using NUnit.Framework;
  8. using System;
  9. using System.Collections;
  10. using System.Collections.Specialized;
  11. namespace MonoTests.System.Collections.Specialized
  12. {
  13. public class HybridDictionaryTest : TestCase
  14. {
  15. public HybridDictionaryTest () :
  16. base ("[MonoTests.System.Net.HybridDictionaryTest]") {}
  17. public HybridDictionaryTest (string name) : base (name) {}
  18. protected override void SetUp () {}
  19. protected override void TearDown () {}
  20. public static ITest Suite
  21. {
  22. get {
  23. return new TestSuite (typeof (HybridDictionaryTest));
  24. }
  25. }
  26. public void TestAll ()
  27. {
  28. HybridDictionary dict = new HybridDictionary (true);
  29. dict.Add ("CCC", "ccc");
  30. dict.Add ("BBB", "bbb");
  31. dict.Add ("fff", "fff");
  32. dict ["EEE"] = "eee";
  33. dict ["ddd"] = "ddd";
  34. AssertEquals ("#1", 5, dict.Count);
  35. AssertEquals ("#2", "eee", dict ["eee"]);
  36. dict.Add ("CCC2", "ccc");
  37. dict.Add ("BBB2", "bbb");
  38. dict.Add ("fff2", "fff");
  39. dict ["EEE2"] = "eee";
  40. dict ["ddd2"] = "ddd";
  41. dict ["xxx"] = "xxx";
  42. dict ["yyy"] = "yyy";
  43. AssertEquals ("#3", 12, dict.Count);
  44. AssertEquals ("#4", "eee", dict ["eee"]);
  45. }
  46. }
  47. }