Exemplo n.º 1
0
        public void ReturnsFalseWhenCollectionIsEmpty()
        {
            HierarchyTreeViewItemCollection collection;


            collection = new HierarchyTreeViewItemCollection(Enumerable.Empty <HierarchyTreeViewItem>());

            Assert.False(collection.CalculateCheckedState());
        }
Exemplo n.º 2
0
        public void ReturnsNullWhenAllItemsAreIndeterminate()
        {
            HierarchyTreeViewItemCollection collection;


            collection = new HierarchyTreeViewItemCollection(new[] {
                Factory.CreateTreeViewItem(isChecked: null),
                Factory.CreateTreeViewItem(isChecked: null),
                Factory.CreateTreeViewItem(isChecked: null),
            });

            Assert.Null(collection.CalculateCheckedState());
        }
Exemplo n.º 3
0
        public void ReturnsNullWhenSomeItemsAreChecked()
        {
            HierarchyTreeViewItemCollection collection;


            collection = new HierarchyTreeViewItemCollection(new[] {
                Factory.CreateTreeViewItem(isChecked: true),
                Factory.CreateTreeViewItem(isChecked: false),
                Factory.CreateTreeViewItem(isChecked: true),
            });

            Assert.Null(collection.CalculateCheckedState());
        }
Exemplo n.º 4
0
        public void ReturnsTrueWhenAllItemsAreChecked()
        {
            HierarchyTreeViewItemCollection collection;


            collection = new HierarchyTreeViewItemCollection(new[] {
                Factory.CreateTreeViewItem(isChecked: true),
                Factory.CreateTreeViewItem(isChecked: true),
                Factory.CreateTreeViewItem(isChecked: true),
            });

            Assert.True(collection.CalculateCheckedState());
        }
Exemplo n.º 5
0
        public void ReturnsFalseWhenNoItemsAreChecked()
        {
            HierarchyTreeViewItemCollection collection;


            collection = new HierarchyTreeViewItemCollection(new[] {
                Factory.CreateTreeViewItem(isChecked: false),
                Factory.CreateTreeViewItem(isChecked: false),
                Factory.CreateTreeViewItem(isChecked: false)
            });

            Assert.False(collection.CalculateCheckedState());
        }