Avalonia.Base.UnitTests.Styling.StyleTests.Adding_Style_Should_Attach_To_Control C# (CSharp) Method

Adding_Style_Should_Attach_To_Control() private method

private Adding_Style_Should_Attach_To_Control ( ) : void
return void
        public void Adding_Style_Should_Attach_To_Control()
        {
            using (UnitTestApplication.Start(TestServices.RealStyler))
            {
                var border = new Border();
                var root = new TestRoot
                {
                    Styles =
                    {
                        new Style(x => x.OfType<Border>())
                        {
                            Setters =
                            {
                                new Setter(Border.BorderThicknessProperty, new Thickness(4)),
                            }
                        }
                    },
                    Child = border,
                };

                root.Measure(Size.Infinity);
                Assert.Equal(new Thickness(4), border.BorderThickness);

                root.Styles.Add(new Style(x => x.OfType<Border>())
                {
                    Setters =
                    {
                        new Setter(Border.BorderThicknessProperty, new Thickness(6)),
                    }
                });

                root.Measure(Size.Infinity);
                Assert.Equal(new Thickness(6), border.BorderThickness);
            }
        }