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

Code before:
            Change_Propery_And_Verify_Measure_Requested(grid, () =>
            {
                if (setUsingAvaloniaProperty)
                    grid.RowDefinitions[0][RowDefinition.MaxHeightProperty] = 5;
                else
                    grid.RowDefinitions[0].MaxHeight = 5;
            });
        }

        [Fact]
        public void Adding_Column_Should_Invalidate_Grid()
        {
            var grid = new Grid { ColumnDefinitions = ColumnDefinitions.Parse("1*,1*") };

            Change_Propery_And_Verify_Measure_Requested(grid, () =>
            {
                grid.ColumnDefinitions.Add(new ColumnDefinition(new GridLength(5)));
            });
        }

        [Fact]
        public void Adding_Row_Should_Invalidate_Grid()
        {
            var grid = new Grid { RowDefinitions = RowDefinitions.Parse("1*,1*") };

            Change_Propery_And_Verify_Measure_Requested(grid, () =>
            {
                grid.RowDefinitions.Add(new RowDefinition(new GridLength(5)));
            });
        }

        [Fact]
        public void Replacing_Columns_Should_Invalidate_Grid()
        {
            var grid = new Grid { ColumnDefinitions = ColumnDefinitions.Parse("1*,1*") };

            Change_Propery_And_Verify_Measure_Requested(grid, () =>
            {
                grid.ColumnDefinitions = ColumnDefinitions.Parse("2*,1*");
            });
        }

        [Fact]
        public void Replacing_Rows_Should_Invalidate_Grid()
        {
            var grid = new Grid { RowDefinitions = RowDefinitions.Parse("1*,1*") };

            Change_Propery_And_Verify_Measure_Requested(grid, () =>
            {
                grid.RowDefinitions = RowDefinitions.Parse("2*,1*");
            });

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

Code after:
            Change_Property_And_Verify_Measure_Requested(grid, () =>
            {
                if (setUsingAvaloniaProperty)
                    grid.RowDefinitions[0][RowDefinition.MaxHeightProperty] = 5;
                else
                    grid.RowDefinitions[0].MaxHeight = 5;
            });
        }

        [Fact]
        public void Adding_Column_Should_Invalidate_Grid()
        {
            var grid = new Grid { ColumnDefinitions = ColumnDefinitions.Parse("1*,1*") };

            Change_Property_And_Verify_Measure_Requested(grid, () =>
            {
                grid.ColumnDefinitions.Add(new ColumnDefinition(new GridLength(5)));
            });
        }

        [Fact]
        public void Adding_Row_Should_Invalidate_Grid()
        {
            var grid = new Grid { RowDefinitions = RowDefinitions.Parse("1*,1*") };

            Change_Property_And_Verify_Measure_Requested(grid, () =>
            {
                grid.RowDefinitions.Add(new RowDefinition(new GridLength(5)));
            });
        }

        [Fact]
        public void Replacing_Columns_Should_Invalidate_Grid()
        {
            var grid = new Grid { ColumnDefinitions = ColumnDefinitions.Parse("1*,1*") };

            Change_Property_And_Verify_Measure_Requested(grid, () =>
            {
                grid.ColumnDefinitions = ColumnDefinitions.Parse("2*,1*");
            });
        }

        [Fact]
        public void Replacing_Rows_Should_Invalidate_Grid()
        {
            var grid = new Grid { RowDefinitions = RowDefinitions.Parse("1*,1*") };

            Change_Property_And_Verify_Measure_Requested(grid, () =>
            {
                grid.RowDefinitions = RowDefinitions.Parse("2*,1*");
            });