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); }
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)); }