public void ReturnsFalseWhenCollectionIsEmpty() { HierarchyTreeViewItemCollection collection; collection = new HierarchyTreeViewItemCollection(Enumerable.Empty <HierarchyTreeViewItem>()); Assert.False(collection.CalculateCheckedState()); }
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()); }
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()); }
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()); }
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()); }