public void TestNonMatchingControlTypes()
 {
     using (var e = new MockA11yElement())
     {
         e.ControlTypeId = ControlType.CheckBox;
         var test = new ControlTypeCondition(ControlType.Button);
         Assert.IsFalse(test.Matches(e));
     } // using
 }
コード例 #2
0
        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));
        }
コード例 #3
0
        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);
        }