Ejemplo n.º 1
0
            public void CompiledTypeConverterAreInvoked(bool useCompiledXaml)
            {
                var p = new CompiledTypeConverter(useCompiledXaml);

                Assert.AreEqual(new Rectangle(0, 1, 2, 4), p.RectangleP);
                Assert.AreEqual(new Rectangle(4, 8, 16, 32), p.RectangleBP);
                Assert.AreEqual(Colors.Pink, p.BackgroundColor);
                Assert.AreEqual(LayoutOptions.EndAndExpand, p.label.GetValue(View.HorizontalOptionsProperty));
                var xConstraint = RelativeLayout.GetXConstraint(p.label);

                Assert.AreEqual(2, xConstraint.Compute(null));
                Assert.AreEqual(new Thickness(2, 3), p.label.Margin);
                Assert.AreEqual(2, p.List.Count);
                Assert.AreEqual("Bar", p.List[1]);
            }
Ejemplo n.º 2
0
            public void CompiledTypeConverterAreInvoked(bool useCompiledXaml)
            {
                var p = new CompiledTypeConverter(useCompiledXaml);

                Assert.AreEqual(new Rect(0, 1, 2, 4), p.RectangleP);
                Assert.AreEqual(new Rect(4, 8, 16, 32), p.RectangleBP);
                Assert.AreEqual(new Point(1, 2), p.PointP);
                Assert.AreEqual(Brush.Red, p.BrushByName);
                Assert.AreEqual(new Color(1, 2, 3, 0), ((SolidColorBrush)p.BrushByARGB).Color);
                Assert.AreEqual(new Color(1, 2, 3), ((SolidColorBrush)p.BrushByRGB).Color);
                Assert.AreEqual(Colors.Pink, p.BackgroundColor);
                Assert.AreEqual(LayoutOptions.EndAndExpand, p.label.GetValue(View.HorizontalOptionsProperty));
                var xConstraint = Microsoft.Maui.Controls.Compatibility.RelativeLayout.GetXConstraint(p.label);

                Assert.AreEqual(2, xConstraint.Compute(null));
                Assert.AreEqual(new Thickness(2, 3), p.label.Margin);
                Assert.AreEqual(2, p.List.Count);
                Assert.AreEqual("Bar", p.List[1]);
            }