}
+ [Test]
+ public void MinimumWidthRequestInAutoCells()
+ {
+ var boxRow0Column0 = new BoxView
+ {
+ MinimumWidthRequest = 50,
+ WidthRequest = 200,
+ IsPlatformEnabled = true
+ };
+ var boxRow1Column0 = new BoxView
+ {
+ MinimumWidthRequest = 50,
+ WidthRequest = 200,
+ IsPlatformEnabled = true
+ };
+
+ var boxRow0Column1 = new BoxView
+ {
+ WidthRequest = 800,
+ IsPlatformEnabled = true
+ };
+ var boxRow1Column1 = new BoxView
+ {
+ WidthRequest = 800,
+ IsPlatformEnabled = true
+ };
+
+ var grid = new Grid
+ {
+ IsPlatformEnabled = true,
+ BackgroundColor = Color.Red
+ };
+
+ grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
+ grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
+
+ grid.Children.Add(boxRow0Column0, 0, 0);
+ grid.Children.Add(boxRow1Column0, 0, 1);
+ grid.Children.Add(boxRow1Column1, 1, 1);
+ grid.Children.Add(boxRow0Column1, 1, 0);
+
+ var view = new ContentView
+ {
+ IsPlatformEnabled = true,
+ Content = grid,
+ };
+ view.Layout(new Rectangle(0, 0, 800, 800));
+
+
+ Assert.AreEqual(boxRow0Column0.MinimumWidthRequest, boxRow0Column0.Width);
+ Assert.AreEqual(boxRow1Column0.MinimumWidthRequest, boxRow1Column0.Width);
+ }
+
+
+ [Test]
+ public void MinimumHeightRequestInAutoCells()
+ {
+ var boxRow0Column0 = new BoxView
+ {
+ MinimumHeightRequest = 50,
+ HeightRequest = 800,
+ IsPlatformEnabled = true
+ };
+ var boxRow1Column0 = new BoxView
+ {
+ HeightRequest = 800,
+ IsPlatformEnabled = true
+ };
+
+ var boxRow0Column1 = new BoxView
+ {
+ MinimumHeightRequest = 50,
+ HeightRequest = 800,
+ IsPlatformEnabled = true
+ };
+ var boxRow1Column1 = new BoxView
+ {
+ HeightRequest = 800,
+ IsPlatformEnabled = true
+ };
+
+ var grid = new Grid
+ {
+ IsPlatformEnabled = true,
+ BackgroundColor = Color.Red
+ };
+
+ grid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
+ grid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
+
+ grid.Children.Add(boxRow0Column0, 0, 0);
+ grid.Children.Add(boxRow1Column0, 0, 1);
+ grid.Children.Add(boxRow1Column1, 1, 1);
+ grid.Children.Add(boxRow0Column1, 1, 0);
+
+ var view = new ContentView
+ {
+ IsPlatformEnabled = true,
+ Content = grid,
+ };
+ view.Layout(new Rectangle(0, 0, 800, 800));
+
+
+ Assert.AreEqual(boxRow0Column0.MinimumHeightRequest, boxRow0Column0.Height);
+ Assert.AreEqual(boxRow0Column1.MinimumHeightRequest, boxRow0Column1.Height);
+ }
+
+
+
// because the constraint is internal, we need this
public enum HackLayoutConstraint
{