public virtual void TimeUpDownPeerOnlySupportsValuePattern() { TimeUpDown item = new TimeUpDown(); TimeUpDownAutomationPeer peer = null; TestAsync( item, () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(item) as TimeUpDownAutomationPeer, () => Assert.IsNull(peer.GetPattern(PatternInterface.Dock), "TimeUpDownAutomationPeer should not support the Dock pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.ExpandCollapse), "TimeUpDownAutomationPeer should not support the ExpandCollapse pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Grid), "TimeUpDownAutomationPeer should not support the Grid pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.GridItem), "TimeUpDownAutomationPeer should not support the GridItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Invoke), "TimeUpDownAutomationPeer should not support the Dock pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.MultipleView), "TimeUpDownAutomationPeer should not support the MultipleView pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.RangeValue), "TimeUpDownAutomationPeer should not support the RangeValue pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Scroll), "TimeUpDownAutomationPeer should not support the Scroll pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.ScrollItem), "TimeUpDownAutomationPeer should not support the ScrollItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Selection), "TimeUpDownAutomationPeer should not support the Selection pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Table), "TimeUpDownAutomationPeer should not support the Table pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.TableItem), "TimeUpDownAutomationPeer should not support the TableItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Toggle), "TimeUpDownAutomationPeer should not support the Toggle pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Transform), "TimeUpDownAutomationPeer should not support the Transform pattern!"), () => Assert.IsNotNull(peer.GetPattern(PatternInterface.Value), "TimeUpDownAutomationPeer should support the Value pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Window), "TimeUpDownAutomationPeer should not support the Window pattern!")); }
public virtual void CreateTimeUpDownPeer() { TimeUpDown tud = new TimeUpDown(); TimeUpDownAutomationPeer peer = new TimeUpDownAutomationPeer(tud); Assert.IsNotNull(peer); }
public virtual void TimeUpDownCreatesCorrectAutomationPeer() { TimeUpDown tud = new TimeUpDown(); TimeUpDownAutomationPeer peer = null; TestAsync( tud, () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(tud) as TimeUpDownAutomationPeer, () => Assert.IsNotNull(peer, "TimeUpDown peer should not be null!"), () => Assert.AreEqual(tud, peer.Owner, "TimeUpDown should be owner of the peer!")); }
public virtual void ShouldCorrelateReadOnlyToIsEnabledInAutomationPeer() { TimeUpDown item = new TimeUpDown(); item.Value = new DateTime(1900, 1, 1, 3, 45, 12); TimeUpDownAutomationPeer peer = null; IValueProvider provider = null; TestAsync( item, () => peer = (TimeUpDownAutomationPeer)FrameworkElementAutomationPeer.CreatePeerForElement(item), () => provider = (IValueProvider)peer.GetPattern(PatternInterface.Value), () => Assert.IsFalse(provider.IsReadOnly), () => item.IsEnabled = false, () => Assert.IsTrue(provider.IsReadOnly)); }
public virtual void ShouldBeAbleToGetValueThroughAutomationPeer() { TimeUpDown item = new TimeUpDown(); item.Culture = new CultureInfo("nl-NL"); item.Format = new CustomTimeFormat("HH:mm:ss"); item.Value = new DateTime(1900, 1, 1, 3, 45, 12); TimeUpDownAutomationPeer peer = null; IValueProvider provider = null; TestAsync( item, () => peer = (TimeUpDownAutomationPeer)FrameworkElementAutomationPeer.CreatePeerForElement(item), () => provider = (IValueProvider)peer.GetPattern(PatternInterface.Value), () => Assert.AreEqual(provider.Value, "03:45:12")); }