public virtual void RatingItemCreatesAutomationPeer() { RatingItem item = new RatingItem(); RatingItemAutomationPeer peer = null; TestAsync( item, () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(item) as RatingItemAutomationPeer, () => Assert.IsNotNull(peer, "RatingItem peer should not be null!"), () => Assert.AreEqual(item, peer.Owner, "RatingItem should be owner of the peer!")); }
public virtual void RatingItemAutomationPeerTypeAndClass() { RatingItem item = new RatingItem(); RatingItemAutomationPeer peer = null; TestAsync( item, () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(item) as RatingItemAutomationPeer, () => Assert.AreEqual(AutomationControlType.ListItem, peer.GetAutomationControlType(), "Unexpected AutomationControlType!"), () => Assert.AreEqual("RatingItem", peer.GetClassName(), "Unexpected ClassType!")); }
public virtual void RatingItemPeerSupportsSelection() { RatingItem item = new RatingItem(); RatingItemAutomationPeer peer = null; ISelectionItemProvider provider = null; TestAsync( item, () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(item) as RatingItemAutomationPeer, () => provider = peer.GetPattern(PatternInterface.SelectionItem) as ISelectionItemProvider, () => Assert.IsNotNull(provider, "ISelectionItemProvider peer should not be null!")); }
public virtual void RatingItemPeerOnlySupportsSelectionAndExpandCollapse() { RatingItem item = new RatingItem(); RatingItemAutomationPeer peer = null; TestAsync( item, () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(item) as RatingItemAutomationPeer, () => Assert.IsNull(peer.GetPattern(PatternInterface.Dock), "RatingItemAutomationPeer should not support the Dock pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Grid), "RatingItemAutomationPeer should not support the Grid pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.GridItem), "RatingItemAutomationPeer should not support the GridItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Invoke), "RatingItemAutomationPeer should not support the Dock pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.MultipleView), "RatingItemAutomationPeer should not support the MultipleView pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.RangeValue), "RatingItemAutomationPeer should support the RangeValue pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Scroll), "RatingItemAutomationPeer should not support the Scroll pattern!"), () => Assert.IsNotNull(peer.GetPattern(PatternInterface.SelectionItem), "RatingItemAutomationPeer should support the SelectionItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.ExpandCollapse), "RatingItemAutomationPeer should not support the ExpandCollapse pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Table), "RatingItemAutomationPeer should not support the Table pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.TableItem), "RatingItemAutomationPeer should not support the TableItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Toggle), "RatingItemAutomationPeer should not support the Toggle pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Transform), "RatingItemAutomationPeer should not support the Transform pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Value), "RatingItemAutomationPeer should not support the Value pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Window), "RatingItemAutomationPeer should not support the Window pattern!")); }