示例#1
0
        public async Task HorizontalTextAlignmentInitializesCorrectly()
        {
            var xplatHorizontalTextAlignment = TextAlignment.End;

            var editorStub = new EditorStub()
            {
                Text = "Test",
                HorizontalTextAlignment = xplatHorizontalTextAlignment
            };

            UITextAlignment expectedValue = UITextAlignment.Right;

            var values = await GetValueAsync(editorStub, (handler) =>
            {
                return(new
                {
                    ViewValue = editorStub.HorizontalTextAlignment,
                    NativeViewValue = GetNativeHorizontalTextAlignment(handler)
                });
            });

            Assert.Equal(xplatHorizontalTextAlignment, values.ViewValue);
            values.NativeViewValue.AssertHasFlag(expectedValue);
        }
示例#2
0
        public async Task CharacterSpacingInitializesCorrectly()
        {
            var xplatCharacterSpacing = 4;

            var editor = new EditorStub()
            {
                CharacterSpacing = xplatCharacterSpacing,
                Text             = "Test"
            };

            float expectedValue = editor.CharacterSpacing.ToEm();

            var values = await GetValueAsync(editor, (handler) =>
            {
                return(new
                {
                    ViewValue = editor.CharacterSpacing,
                    NativeViewValue = GetNativeCharacterSpacing(handler)
                });
            });

            Assert.Equal(xplatCharacterSpacing, values.ViewValue);
            Assert.Equal(expectedValue, values.NativeViewValue, EmCoefficientPrecision);
        }