public void UITestControlCollection_Contains() { UITestControlCollection siblings = CheckBox.GetParent().GetChildren(); siblings.Should().NotBeNullOrEmpty("because the CheckBox should have siblings"); var firstItem = siblings.First(); siblings .Contains(firstItem) .Should() .BeTrue("because collection should contain its first Item."); }
public void UITestControlCollection_CanRemoveItem() { UITestControlCollection siblings = CheckBox.GetParent().GetChildren(); siblings.Should().NotBeNullOrEmpty("because the CheckBox should have siblings"); var countBeforeRemoving = siblings.Count; var lastItem = siblings.Last(); siblings .Remove(lastItem) .Should() .BeTrue("because it should be possible to remove an Item."); siblings .Count .Should() .Be(countBeforeRemoving - 1, "because count should change."); siblings .Contains(lastItem) .Should() .BeFalse("because the item has been removed."); }