|
|
|
@ -261,6 +261,37 @@ namespace Avalonia.Markup.Xaml.UnitTests.Xaml |
|
|
|
var grid = AvaloniaRuntimeXamlLoader.Parse<Grid>(xaml); |
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(4, grid.ColumnDefinitions.Count); |
|
|
|
Assert.Equal(4, grid.RowDefinitions.Count); |
|
|
|
|
|
|
|
var expected1 = new GridLength(100); |
|
|
|
var expected2 = GridLength.Auto; |
|
|
|
var expected3 = new GridLength(1, GridUnitType.Star); |
|
|
|
var expected4 = new GridLength(100, GridUnitType.Star); |
|
|
|
|
|
|
|
Assert.Equal(expected1, grid.ColumnDefinitions[0].Width); |
|
|
|
Assert.Equal(expected2, grid.ColumnDefinitions[1].Width); |
|
|
|
Assert.Equal(expected3, grid.ColumnDefinitions[2].Width); |
|
|
|
Assert.Equal(expected4, grid.ColumnDefinitions[3].Width); |
|
|
|
|
|
|
|
Assert.Equal(expected1, grid.RowDefinitions[0].Height); |
|
|
|
Assert.Equal(expected2, grid.RowDefinitions[1].Height); |
|
|
|
Assert.Equal(expected3, grid.RowDefinitions[2].Height); |
|
|
|
Assert.Equal(expected4, grid.RowDefinitions[3].Height); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void Grid_Row_Col_Definitions_Are_Parsed_Space_Delimiter() |
|
|
|
{ |
|
|
|
var xaml = @"
|
|
|
|
<Grid xmlns='https://github.com/avaloniaui'
|
|
|
|
ColumnDefinitions='100 Auto * 100*' |
|
|
|
RowDefinitions='100 Auto * 100*'> |
|
|
|
</Grid>";
|
|
|
|
|
|
|
|
var grid = AvaloniaRuntimeXamlLoader.Parse<Grid>(xaml); |
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(4, grid.ColumnDefinitions.Count); |
|
|
|
Assert.Equal(4, grid.RowDefinitions.Count); |
|
|
|
|
|
|
|
|