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

            var entry = new EntryStub()
            {
                Text = "Test",
                HorizontalTextAlignment = xplatHorizontalTextAlignment
            };

            Android.Views.TextAlignment expectedValue = Android.Views.TextAlignment.ViewEnd;

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

            Assert.Equal(xplatHorizontalTextAlignment, values.ViewValue);
            values.PlatformViewValue.AssertHasFlag(expectedValue);
        }
示例#2
0
        public async Task HorizontalTextAlignmentInitializesCorrectly()
        {
            var xplatHorizontalTextAlignment = TextAlignment.End;

            var searchBarStub = new SearchBarStub()
            {
                Text = "Test",
                HorizontalTextAlignment = xplatHorizontalTextAlignment
            };

            Android.Views.TextAlignment expectedValue = Android.Views.TextAlignment.ViewEnd;

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

            Assert.Equal(xplatHorizontalTextAlignment, values.ViewValue);
            values.NativeViewValue.AssertHasFlag(expectedValue);
        }