public void NoEncapsulationTest()
        {
            var ed = new EncapsulatingDictionary <string, string>();

            ed["name"] = "anne";
            ed["age"]  = "82";

            Assert.AreEqual(2, ed.Count);
            Assert.AreEqual(ed.ShallowCount, ed.DeepCount);
            Assert.AreEqual(1, ed.Depth);

            Assert.AreEqual("anne", ed["name"]);
            Assert.AreEqual("82", ed["age"]);

            ed.Add("city", "syrupville");
            Assert.AreEqual(3, ed.Count);
            Assert.AreEqual(ed.ShallowCount, ed.DeepCount);
            Assert.AreEqual(1, ed.Depth);
            Assert.IsTrue(ed.ContainsKey("name"));
            Assert.IsTrue(ed.ContainsKey("age"));
            Assert.IsTrue(ed.ContainsKey("city"));
            Assert.IsFalse(ed.ContainsKey("state"));


            Assert.IsFalse(ed.Remove("state"));
            Assert.AreEqual(3, ed.Count);
            Assert.AreEqual(ed.ShallowCount, ed.DeepCount);
            Assert.AreEqual(1, ed.Depth);

            Assert.IsTrue(ed.Remove("age"));
            Assert.AreEqual(2, ed.Count);
            Assert.AreEqual(ed.ShallowCount, ed.DeepCount);
            Assert.AreEqual(1, ed.Depth);


            ed.Clear();
            Assert.AreEqual(0, ed.Count);
            Assert.AreEqual(ed.ShallowCount, ed.DeepCount);
            Assert.AreEqual(1, ed.Depth);
        }
        public void RemoveTest()
        {
            Assert.AreEqual("3c", _3["c"]);
            Assert.IsTrue(_3.Remove("c"));
            Assert.AreEqual("2c", _3["c"]);

            Assert.AreEqual("2b", _3["b"]);
            Assert.IsFalse(_3.Remove("b"));
            Assert.AreEqual("2b", _3["b"]);
            Assert.IsTrue(_2.Remove("b"));
            Assert.AreEqual("1b", _3["b"]);
            Assert.IsTrue(_1.Remove("b"));
            Assert.AreEqual("1b", _3["b"]);   // exception- keynotfound
        }