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

Removing_Nested_Style_Should_Detach_From_Control() private method

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

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

                ((Styles)root.Styles[0]).RemoveAt(1);

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