public void TestNonMatchingControlTypes() { using (var e = new MockA11yElement()) { e.ControlTypeId = ControlType.CheckBox; var test = new ControlTypeCondition(ControlType.Button); Assert.IsFalse(test.Matches(e)); } // using }
public override bool PassesTest(IA11yElement e) { if (e == null) { throw new ArgumentNullException(nameof(e)); } var controlType = new ControlTypeCondition(e.ControlTypeId); var condition = SiblingCount(controlType & SelectionItemPattern.IsSelected) <= 1; return(condition.Matches(e)); }
public override EvaluationCode Evaluate(IA11yElement e) { if (e == null) { throw new ArgumentNullException(nameof(e)); } var controlType = new ControlTypeCondition(e.ControlTypeId); var condition = SiblingCount(controlType & SelectionItemPattern.IsSelected) <= 1; return(condition.Matches(e) ? EvaluationCode.Pass : EvaluationCode.Error); }