Repository: AvaloniaUI/Avalonia
File: tests/Avalonia.Controls.UnitTests/GridTests.cs (C#)

Code before:
                RowDefinitions = RowDefinitions.Parse("Auto"),
                Children =
                {
                    new TestControl
                    {
                        MeasureSize = new Size(150, 150),
                    }
                }
            };

            var parent = new Decorator { Child = grid };

            parent.Measure(new Size(100, 100));
            parent.Arrange(new Rect(grid.DesiredSize));

            Assert.Equal(new Size(100, 100), grid.Bounds.Size);
        }

        [Theory]
        [InlineData(true)]
        [InlineData(false)]
        public void Changing_Column_Width_Should_Invalidate_Grid(bool setUsingAvaloniaProperty)
        {
            var grid = new Grid { ColumnDefinitions = ColumnDefinitions.Parse("1*,1*") };

            Change_Propery_And_Verify_Measure_Requested(grid, () =>
            {
                if (setUsingAvaloniaProperty)
                    grid.ColumnDefinitions[0][ColumnDefinition.WidthProperty] = new GridLength(5);
                else
                    grid.ColumnDefinitions[0].Width = new GridLength(5);
            });
        }

        [Theory]
        [InlineData(true)]
        [InlineData(false)]
        public void Changing_Column_MinWidth_Should_Invalidate_Grid(bool setUsingAvaloniaProperty)
        {
            var grid = new Grid { ColumnDefinitions = ColumnDefinitions.Parse("1*,1*") };

            Change_Propery_And_Verify_Measure_Requested(grid, () =>
            {
                if (setUsingAvaloniaProperty)
                    grid.ColumnDefinitions[0][ColumnDefinition.MinWidthProperty] = 5;
                else
                    grid.ColumnDefinitions[0].MinWidth = 5;
            });
        }

        [Theory]

Review comment (suggestion):
```suggestion
            Change_Property_And_Verify_Measure_Requested(grid, () =>
```

Code after:
                RowDefinitions = RowDefinitions.Parse("Auto"),
                Children =
                {
                    new TestControl
                    {
                        MeasureSize = new Size(150, 150),
                    }
                }
            };

            var parent = new Decorator { Child = grid };

            parent.Measure(new Size(100, 100));
            parent.Arrange(new Rect(grid.DesiredSize));

            Assert.Equal(new Size(100, 100), grid.Bounds.Size);
        }

        [Theory]
        [InlineData(true)]
        [InlineData(false)]
        public void Changing_Column_Width_Should_Invalidate_Grid(bool setUsingAvaloniaProperty)
        {
            var grid = new Grid { ColumnDefinitions = ColumnDefinitions.Parse("1*,1*") };

            Change_Property_And_Verify_Measure_Requested(grid, () =>
            {
                if (setUsingAvaloniaProperty)
                    grid.ColumnDefinitions[0][ColumnDefinition.WidthProperty] = new GridLength(5);
                else
                    grid.ColumnDefinitions[0].Width = new GridLength(5);
            });
        }

        [Theory]
        [InlineData(true)]
        [InlineData(false)]
        public void Changing_Column_MinWidth_Should_Invalidate_Grid(bool setUsingAvaloniaProperty)
        {
            var grid = new Grid { ColumnDefinitions = ColumnDefinitions.Parse("1*,1*") };

            Change_Property_And_Verify_Measure_Requested(grid, () =>
            {
                if (setUsingAvaloniaProperty)
                    grid.ColumnDefinitions[0][ColumnDefinition.MinWidthProperty] = 5;
                else
                    grid.ColumnDefinitions[0].MinWidth = 5;
            });
        }

        [Theory]