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

            Assert.AreEqual(0, ed.Count);
            Assert.AreEqual(0, ed.DeepCount);
            Assert.AreEqual(0, ed.ShallowCount);

            foreach (var _nothing in ed)
            {
                Assert.Fail();
            }

            Assert.AreEqual(1, ed.Depth);
        }
        public void SetMembers()
        {
            _1 = new EncapsulatingDictionary <string, string>();
            _2 = new EncapsulatingDictionary <string, string>(_1);
            _3 = new EncapsulatingDictionary <string, string>(_2);

            _1["all"] = "1";
            _2["all"] = "2";
            _3["all"] = "3";

            _1["a"] = "1a";
            _1["b"] = "1b";
            _2["b"] = "2b";
            _2["c"] = "2c";
            _3["a"] = "3a";
            _3["c"] = "3c";
        }
        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);
        }