Exemplo n.º 1
0
        public void AddChildAddsItemToChildrenOfParent()
        {
            var one = new HyperDictionary();
            var two = new HyperDictionary();
            one.AddChild(two);

            var oneChildrenInfo = one.GetType().GetField("children", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
            var oneChildren = oneChildrenInfo.GetValue(one) as IEnumerable<HyperDictionary>;
            Assert.IsTrue(oneChildren.Contains(two));
        }
Exemplo n.º 2
0
        public void InheritsFromDoesNotAddItemToChildrenOfParent()
        {
            var one = new HyperDictionary();
            var two = new HyperDictionary();
            two.InheritsFrom(one);

            var oneChildrenInfo = one.GetType().GetField("children", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
            var oneChildren = oneChildrenInfo.GetValue(one) as IEnumerable<HyperDictionary>;
            Assert.IsFalse(oneChildren.Contains(two));
        }