Skip to content

Commit 033e9b1

Browse files
committed
Update UI unit test
1 parent 6954c05 commit 033e9b1

File tree

4 files changed

+23
-21
lines changed

4 files changed

+23
-21
lines changed

UITests/UITests.App/UITests.App.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,14 @@
227227
<Project>{e9faabfb-d726-42c1-83c1-cb46a29fea81}</Project>
228228
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Core</Name>
229229
</ProjectReference>
230+
<ProjectReference Include="..\..\Microsoft.Toolkit.Uwp.UI.Controls.Primitives\Microsoft.Toolkit.Uwp.UI.Controls.Primitives.csproj">
231+
<Project>{84ab7dc5-95c9-4cf8-a370-d077e9e9ef1a}</Project>
232+
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Primitives</Name>
233+
</ProjectReference>
234+
<ProjectReference Include="..\..\Microsoft.Toolkit.Uwp.UI.Controls\Microsoft.Toolkit.Uwp.UI.Controls.csproj">
235+
<Project>{099b60fd-dad6-4648-9de2-8dbf9dcd9557}</Project>
236+
<Name>Microsoft.Toolkit.Uwp.UI.Controls</Name>
237+
</ProjectReference>
230238
<ProjectReference Include="..\..\Microsoft.Toolkit.Uwp.UI.Media\Microsoft.Toolkit.Uwp.UI.Media.csproj">
231239
<Project>{75f9ee44-3efa-47bc-aedd-351b9834a0af}</Project>
232240
<Name>Microsoft.Toolkit.Uwp.UI.Media</Name>

UITests/UITests.Tests.Shared/Controls/ConstrainedBoxTest.cs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,11 @@ public static void ClassInitialize(TestContext testContext)
3232

3333
[TestMethod]
3434
[TestPage("ConstrainedBoxTestPage")]
35-
public void SimpleTestMethod()
35+
public void Test_AspectRatioBoundToInteger_Placeholder()
3636
{
37-
//ConstrainedBox cb;
38-
//var button = new Button(FindElement.ByName("Click Me"));
39-
//var textBlock = new TextBlock(FindElement.ById("textBlock"));
40-
41-
//Verify.IsNotNull(button);
42-
43-
//Verify.AreEqual(string.Empty, textBlock.GetText());
44-
45-
//button.Click();
46-
47-
//Wait.ForIdle();
48-
49-
//Verify.AreEqual("Clicked", textBlock.GetText());
37+
// The test is if the AspectRatio can be bound to integer
38+
// This test method acts as a placeholder, to spawn the XAML test page
39+
// and test the binding to an integer
5040
}
5141
}
5242
}
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<Page x:Class="UITests.App.Pages.ConstrainedBoxTestPage"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
45
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
56
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6-
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
77
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
88
mc:Ignorable="d">
9-
<Grid>
10-
<controls:ConstrainedBox />
11-
</Grid>
12-
13-
14-
<!--<controls:ConstrainedBox />-->
9+
<controls:ConstrainedBox x:Name="ConstrainedBox"
10+
Height="100"
11+
AspectRatio="{x:Bind IntegerWidth}">
12+
<Border HorizontalAlignment="Stretch"
13+
VerticalAlignment="Stretch"
14+
Background="Red" />
15+
</controls:ConstrainedBox>
1516
</Page>

UITests/UITests.Tests.Shared/Controls/ConstrainedBoxTestPage.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ namespace UITests.App.Pages
1010
{
1111
public sealed partial class ConstrainedBoxTestPage : Page
1212
{
13+
public int IntegerWidth { get; set; } = 2;
14+
15+
1316
public ConstrainedBoxTestPage()
1417
{
1518
this.InitializeComponent();

0 commit comments

Comments
 (0)