Example #1
0
        public void IfChildChangeCheckedStateToAnotherThenParentsAlsoChangeCheckState()
        {
            //Arrange
            node = NestedTripleTreeNodeTest.CreateTestTree();
            NestedTripleTreeNode child21 = node.GetChild(1).GetChild(0);

            //Act
            child21.CheckState = System.Windows.Forms.CheckState.Checked;

            //Assert
            Assert.AreEqual(System.Windows.Forms.CheckState.Checked, child21.GetChild(0).CheckState);
            Assert.AreEqual(System.Windows.Forms.CheckState.Checked, child21.GetChild(1).CheckState);
            Assert.AreEqual(System.Windows.Forms.CheckState.Checked, child21.CheckState);
            Assert.AreEqual(System.Windows.Forms.CheckState.Indeterminate, child21.Parent.CheckState);
            Assert.AreEqual(System.Windows.Forms.CheckState.Indeterminate, child21.Parent.Parent.CheckState);
        }
Example #2
0
        public void AllSubnodesIsCheckedWhenParentIsChecked()
        {
            //Arrange
            node = NestedTripleTreeNodeTest.CreateTestTree();
            NestedTripleTreeNode child2 = node.GetChild(1);

            //Act
            child2.CheckState = System.Windows.Forms.CheckState.Checked;

            //Assert
            Assert.AreEqual(System.Windows.Forms.CheckState.Checked, child2.CheckState);
            Assert.AreEqual(System.Windows.Forms.CheckState.Checked, child2.GetChild(0).CheckState);
            Assert.AreEqual(System.Windows.Forms.CheckState.Checked, child2.GetChild(0).GetChild(0).CheckState);
            Assert.AreEqual(System.Windows.Forms.CheckState.Checked, child2.GetChild(0).GetChild(1).CheckState);
            Assert.AreEqual(System.Windows.Forms.CheckState.Checked, child2.GetChild(1).CheckState);
        }