Пример #1
0
        public virtual void RatingPeerSupportsSelection()
        {
            Rating acc = new Rating();
            RatingAutomationPeer peer     = null;
            ISelectionProvider   provider = null;

            TestAsync(
                acc,
                () => peer     = FrameworkElementAutomationPeer.CreatePeerForElement(acc) as RatingAutomationPeer,
                () => provider = peer.GetPattern(PatternInterface.Selection) as ISelectionProvider,
                () => Assert.IsNotNull(provider, "ISelectionProvider peer should not be null!"));
        }
Пример #2
0
        public virtual void RatingPeerOnlySupportsSelectionAndValue()
        {
            Rating view = new Rating();
            RatingAutomationPeer peer = null;

            TestAsync(
                view,
                () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(view) as RatingAutomationPeer,
                () => Assert.IsNull(peer.GetPattern(PatternInterface.Dock), "RatingAutomationPeer should not support the Dock pattern!"),
                () => Assert.IsNull(peer.GetPattern(PatternInterface.ExpandCollapse), "RatingAutomationPeer should not support the ExpandCollapse pattern!"),
                () => Assert.IsNull(peer.GetPattern(PatternInterface.Grid), "RatingAutomationPeer should not support the Grid pattern!"),
                () => Assert.IsNull(peer.GetPattern(PatternInterface.GridItem), "RatingAutomationPeer should not support the GridItem pattern!"),
                () => Assert.IsNull(peer.GetPattern(PatternInterface.Invoke), "RatingAutomationPeer should not support the Dock pattern!"),
                () => Assert.IsNull(peer.GetPattern(PatternInterface.MultipleView), "RatingAutomationPeer should not support the MultipleView pattern!"),
                () => Assert.IsNull(peer.GetPattern(PatternInterface.RangeValue), "RatingAutomationPeer should not support the RangeValue pattern!"),
                () => Assert.IsNull(peer.GetPattern(PatternInterface.ScrollItem), "RatingAutomationPeer should not support the ScrollItem pattern!"),
                () => Assert.IsNotNull(peer.GetPattern(PatternInterface.Selection), "RatingAutomationPeer should support the Selection pattern!"),
                () => Assert.IsNull(peer.GetPattern(PatternInterface.SelectionItem), "RatingAutomationPeer should not support the SelectionItem pattern!"),
                () => Assert.IsNull(peer.GetPattern(PatternInterface.Table), "RatingAutomationPeer should not support the Table pattern!"),
                () => Assert.IsNull(peer.GetPattern(PatternInterface.TableItem), "RatingAutomationPeer should not support the TableItem pattern!"),
                () => Assert.IsNull(peer.GetPattern(PatternInterface.Toggle), "RatingAutomationPeer should not support the Toggle pattern!"),
                () => Assert.IsNull(peer.GetPattern(PatternInterface.Transform), "RatingAutomationPeer should not support the Transform pattern!"),
                () => Assert.IsNotNull(peer.GetPattern(PatternInterface.Value), "RatingAutomationPeer should support the Value pattern!"),
                () => Assert.IsNull(peer.GetPattern(PatternInterface.Window), "RatingAutomationPeer should not support the Window pattern!"));
        }