Ejemplo n.º 1
0
        public void TestGetChildrenDelegateWorksWithUntypedChildren_WrongTypes()
        {
            Generator.GenerateColumns(this.tolv, typeof(ClassWithUntypedChildren), true);
            ClassWithUntypedChildren parent = new ClassWithUntypedChildren();

            parent.UntypedChildList = new ArrayList();
            parent.UntypedChildList.Add("string");
            parent.UntypedChildList.Add(1);

            ArrayList roots = new ArrayList();

            roots.Add(parent);
            this.tolv.Objects = roots;
            this.tolv.ExpandAll();

            Assert.AreEqual(3, this.tolv.GetItemCount());
        }
Ejemplo n.º 2
0
        public void TestGetChildrenDelegateWorksWithUntypedChildren_NestedChildren()
        {
            Generator.GenerateColumns(this.tolv, typeof(ClassWithUntypedChildren), true);
            ClassWithUntypedChildren parent = new ClassWithUntypedChildren();
            ClassWithUntypedChildren child1 = new ClassWithUntypedChildren();
            ClassWithUntypedChildren child2 = new ClassWithUntypedChildren();

            parent.UntypedChildList = new ArrayList();
            parent.UntypedChildList.Add(child1);
            parent.UntypedChildList.Add(child2);
            child1.UntypedChildList = new ArrayList();
            child1.UntypedChildList.Add(new ClassWithUntypedChildren());
            child2.UntypedChildList = new ArrayList();
            child2.UntypedChildList.Add(new ClassWithUntypedChildren());

            ArrayList roots = new ArrayList();

            roots.Add(parent);
            this.tolv.Objects = roots;
            this.tolv.ExpandAll();

            Assert.AreEqual(5, this.tolv.GetItemCount());
        }
        public void TestGetChildrenDelegateWorksWithUntypedChildren_WrongTypes() {
            Generator.GenerateColumns(this.tolv, typeof(ClassWithUntypedChildren), true);
            ClassWithUntypedChildren parent = new ClassWithUntypedChildren();
            parent.UntypedChildList = new ArrayList();
            parent.UntypedChildList.Add("string");
            parent.UntypedChildList.Add(1);

            ArrayList roots = new ArrayList();
            roots.Add(parent);
            this.tolv.Objects = roots;
            this.tolv.ExpandAll();

            Assert.AreEqual(3, this.tolv.GetItemCount());
        }
        public void TestGetChildrenDelegateWorksWithUntypedChildren_NestedChildren() {
            Generator.GenerateColumns(this.tolv, typeof(ClassWithUntypedChildren), true);
            ClassWithUntypedChildren parent = new ClassWithUntypedChildren();
            ClassWithUntypedChildren child1 = new ClassWithUntypedChildren();
            ClassWithUntypedChildren child2 = new ClassWithUntypedChildren();
            parent.UntypedChildList = new ArrayList();
            parent.UntypedChildList.Add(child1);
            parent.UntypedChildList.Add(child2);
            child1.UntypedChildList = new ArrayList();
            child1.UntypedChildList.Add(new ClassWithUntypedChildren()); 
            child2.UntypedChildList = new ArrayList();
            child2.UntypedChildList.Add(new ClassWithUntypedChildren());

            ArrayList roots = new ArrayList();
            roots.Add(parent);
            this.tolv.Objects = roots;
            this.tolv.ExpandAll();

            Assert.AreEqual(5, this.tolv.GetItemCount());
        }