public async Task CharacterSpacingInitializesCorrectly() { var xplatCharacterSpacing = 4; var items = new List <string> { "Item 1", "Item 2", "Item 3" }; var picker = new PickerStub() { Title = "Select an Item", CharacterSpacing = xplatCharacterSpacing }; picker.ItemsSource = items; picker.SelectedIndex = 0; float expectedValue = picker.CharacterSpacing.ToEm(); var values = await GetValueAsync(picker, (handler) => { return(new { ViewValue = picker.CharacterSpacing, NativeViewValue = GetNativeCharacterSpacing(handler) }); }); Assert.Equal(xplatCharacterSpacing, values.ViewValue); Assert.Equal(expectedValue, values.NativeViewValue, EmCoefficientPrecision); }
public async Task TextColorInitializesCorrectly() { var xplatTitleColor = Colors.CadetBlue; var picker = new PickerStub { Title = "Select an Item", TextColor = xplatTitleColor, Items = new[] { "Item 1", "Item2", "Item3" }, SelectedIndex = 1 }; var expectedValue = xplatTitleColor.ToNative(); var values = await GetValueAsync(picker, (handler) => { return(new { ViewValue = picker.TextColor, NativeViewValue = GetNativeTextColor(handler) }); }); Assert.Equal(xplatTitleColor, values.ViewValue); Assert.Equal(expectedValue, values.NativeViewValue); }
public async Task TitleInitializesCorrectly() { var picker = new PickerStub { Title = "Select an Item" }; await ValidatePropertyInitValue(picker, () => picker.Title, GetNativeTitle, picker.Title); }
public async Task TitleColorInitializesCorrectly() { var picker = new PickerStub { Title = "Select an Item", TitleColor = Colors.CadetBlue }; await ValidatePropertyInitValue(picker, () => picker.TitleColor, GetNativeTitleColor, picker.TitleColor); }
public async Task TextColorInitializesCorrectly() { var picker = new PickerStub { Title = "Select an Item", TextColor = Colors.CadetBlue, Items = new[] { "Item 1", "Item2", "Item3" }, SelectedIndex = 1 }; await ValidatePropertyInitValue(picker, () => picker.TextColor, GetNativeTextColor, picker.TextColor); }
public async Task TitleColorInitializesCorrectly() { var xplatTitleColor = Colors.CadetBlue; var picker = new PickerStub { Title = "Select an Item", TitleColor = xplatTitleColor }; var expectedValue = xplatTitleColor.ToPlatform(); var values = await GetValueAsync(picker, (handler) => { return(new { ViewValue = picker.TitleColor, PlatformViewValue = GetNativeTitleColor(handler) }); }); Assert.Equal(xplatTitleColor, values.ViewValue); Assert.Equal(expectedValue, values.PlatformViewValue); }