コード例 #1
0
        public async Task AccessibilityValueSetsCorrectly()
        {
            var checkboxStub = new CheckBoxStub()
            {
                IsChecked = true
            };

            var onValue = await GetValueAsync(checkboxStub, (handler) => GetNativeCheckBox(handler).AccessibilityValue);

            checkboxStub.IsChecked = false;
            var offValue = await GetValueAsync(checkboxStub, (handler) => GetNativeCheckBox(handler).AccessibilityValue);

            Assert.Equal("1", onValue);
            Assert.Equal("0", offValue);
        }
コード例 #2
0
        public async Task AccessibilityTraitsSetWithHeading()
        {
            var checkboxStub = new CheckBoxStub()
            {
                IsChecked = true,
                Semantics = new Semantics()
                {
                    HeadingLevel = SemanticHeadingLevel.Level4
                }
            };

            var traits = await GetValueAsync(checkboxStub, (handler) => GetNativeCheckBox(handler).AccessibilityTraits);

            var expectedTraits = await InvokeOnMainThreadAsync(() => new UISwitch().AccessibilityTraits);

            Assert.True(traits.HasFlag(expectedTraits));
            Assert.True(traits.HasFlag(UIAccessibilityTrait.Header));
        }