Skip to content

Commit e574466

Browse files
committed
Updated test sample
1 parent e588ae1 commit e574466

File tree

2 files changed

+55
-5
lines changed

2 files changed

+55
-5
lines changed

src/Controls/tests/TestCases.HostApp/Issues/Issue31330.cs

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,76 @@ public class Issue31330 : ContentPage
77
{
88
public Issue31330()
99
{
10-
var grid = new Grid();
10+
Grid grid = new Grid();
11+
grid.RowDefinitions = new RowDefinitionCollection
12+
{
13+
new RowDefinition { Height = GridLength.Auto },
14+
new RowDefinition { Height = GridLength.Auto },
15+
new RowDefinition { Height = GridLength.Star },
16+
new RowDefinition { Height = GridLength.Star }
17+
};
18+
19+
Label labelText = new Label { Text = "The test passes if the edges of the circle touch the BoxView.", FontAttributes = FontAttributes.Bold };
1120

12-
var boxView = new BoxView
21+
BoxView boxView = new BoxView
1322
{
1423
Color = Colors.Green,
1524
HeightRequest = 100,
1625
WidthRequest = 100,
1726
AutomationId = "Issue31330BoxView"
1827
};
1928

20-
var ellipse = new Ellipse
29+
Ellipse ellipse = new Ellipse
2130
{
22-
Fill = new SolidColorBrush(Colors.Red),
23-
StrokeThickness = 20,
31+
Fill = Colors.Yellow,
32+
StrokeThickness = 0,
2433
WidthRequest = 100,
2534
HeightRequest = 100
2635
};
2736

37+
Button button = new Button { Text = "Update StrokeThickness" };
38+
button.Clicked += (s, e) =>
39+
{
40+
ellipse.StrokeThickness = 20;
41+
};
42+
43+
Label label = new Label
44+
{
45+
Text = "Test passes if the Rectangle renders as filled shape for small height",
46+
FontAttributes = FontAttributes.Bold
47+
};
48+
49+
Rectangle rectangle = new Rectangle
50+
{
51+
WidthRequest = 50,
52+
HeightRequest = 1.2,
53+
Fill = Colors.Blue
54+
};
55+
56+
Grid bottomGrid = new Grid { Background = Colors.AliceBlue };
57+
bottomGrid.Children.Add(label);
58+
bottomGrid.Children.Add(rectangle);
59+
60+
bottomGrid.RowDefinitions = new RowDefinitionCollection
61+
{
62+
new RowDefinition { Height = GridLength.Auto },
63+
new RowDefinition { Height = GridLength.Star },
64+
};
65+
66+
bottomGrid.SetRow(label, 0);
67+
bottomGrid.SetRow(rectangle, 1);
68+
69+
grid.Children.Add(labelText);
70+
grid.SetRow(labelText, 0);
71+
grid.Children.Add(button);
72+
grid.SetRow(button, 1);
2873
grid.Children.Add(boxView);
74+
grid.SetRow(boxView, 2);
2975
grid.Children.Add(ellipse);
76+
grid.SetRow(ellipse, 2);
77+
grid.SetRow(bottomGrid, 3);
78+
grid.Children.Add(bottomGrid);
79+
3080
Content = grid;
3181
}
3282
}
46.3 KB
Loading

0 commit comments

Comments
 (0)