public void VerifyMissingOrientationFails() { TestType(AutomationControlType.ScrollBar); TestType(AutomationControlType.Tab); void TestType(AutomationControlType elementType) { var peer = new NoneOrientationPeer(new Button(), elementType); var rule = new OrientationNotNoneRule(); Assert.IsFalse(rule.IsValid(null, peer)); } }
public void VerifyNormalElementsComply() { ProcessElement(new Button()); ProcessElement(new ScrollBar()); ProcessElement(new TextBlock()); ProcessElement(new StackPanel()); void ProcessElement(FrameworkElement element) { var peer = FrameworkElementAutomationPeer.CreatePeerForElement(element); var rule = new OrientationNotNoneRule(); Assert.IsTrue(rule.IsValid(element, peer)); } }