Skip to content

Commit

Permalink
fix: UWP Build
Browse files Browse the repository at this point in the history
  • Loading branch information
vatsashah45 committed Oct 14, 2024
1 parent 57206f4 commit cda836c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/Uno.Toolkit.RuntimeTests/Tests/AncestorBindingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public async Task Ancestor_TopLevel_PageBinding()
var setup = new AncestorBindingTest();
await UnitTestUIContentHelperEx.SetContentAndWait(setup);

var sut = setup.FindFirstDescendant<TextBlock>("TopLevelTextBlock") ?? throw new Exception("Failed to find TopLevelTextBlock");
var sut = setup.GetFirstDescendant<TextBlock>() ?? throw new Exception("Failed to find TopLevelTextBlock");
Assert.AreEqual(sut.Text, setup.Tag);
}

Expand All @@ -40,9 +40,9 @@ public async Task Ancestor_Nested_PageBinding()
var setup = new AncestorBindingTest();
await UnitTestUIContentHelperEx.SetContentAndWait(setup);

var lv = setup.FindFirstDescendant<ListView>("TopLevelListView") ?? throw new Exception("Failed to find TopLevelListView");
var lv = setup.GetFirstDescendant<ListView>() ?? throw new Exception("Failed to find TopLevelListView");
var container = lv.ContainerFromIndex(0);
var sut = (container as FrameworkElement)?.FindFirstDescendant<TextBlock>("NestedLvTextBlock1") ?? throw new Exception("Failed to find NestedLvTextBlock1");
var sut = (container as FrameworkElement)?.GetFirstDescendant<TextBlock>() ?? throw new Exception("Failed to find NestedLvTextBlock1");

Assert.AreEqual(sut.Text, setup.Tag);
}
Expand All @@ -53,9 +53,9 @@ public async Task Ancestor_Nested_LvBinding()
var setup = new AncestorBindingTest();
await UnitTestUIContentHelperEx.SetContentAndWait(setup);

var lv = setup.FindFirstDescendant<ListView>("TopLevelListView") ?? throw new Exception("Failed to find TopLevelListView");
var lv = setup.GetFirstDescendant<ListView>() ?? throw new Exception("Failed to find TopLevelListView");
var container = lv.ContainerFromIndex(0);
var sut = (container as FrameworkElement)?.FindFirstDescendant<TextBlock>("NestedLvTextBlock2") ?? throw new Exception("Failed to find NestedLvTextBlock2");
var sut = (container as FrameworkElement)?.GetFirstDescendant<TextBlock>() ?? throw new Exception("Failed to find NestedLvTextBlock2");
Assert.AreEqual(sut.Text, lv.Tag);
}
}
2 changes: 1 addition & 1 deletion src/Uno.Toolkit.RuntimeTests/Tests/DrawerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ await Task.Run(async () =>
await UIHelper.WaitForIdle();
await UnitTestUIContentHelperEx.WaitFor(() => drawer.AnimationStoryboard?.GetCurrentState() == ClockState.Stopped);

var lightDismissOverlay = drawer.FindFirstDescendant<Border>(x => x.Name == DrawerControl.TemplateParts.LightDismissOverlayName) ??
var lightDismissOverlay = drawer.GetFirstDescendant<Border>() ??
throw new Exception($"Failed to find {DrawerControl.TemplateParts.LightDismissOverlayName}");

await UnitTestUIContentHelperEx.WaitFor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public async Task Smoke_Test()
var host = await ExtendedSplashScreen.GetNativeSplashScreen().ConfigureAwait(false) ?? throw new Exception("Failed to load native splash screen");

#if !__MOBILE__ // ignore native platforms impl: ios,droid,macos
var sut = host.FindFirstDescendant<Image>() ?? throw new Exception("Failed to find splash image control");
var sut = host.GetFirstDescendant<Image>() ?? throw new Exception("Failed to find splash image control");
var tcs = new TaskCompletionSource<(bool Success, string? Message)>();

sut.ImageOpened += (s, e) => tcs.SetResult((Success: true, null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ public async Task ProvideValue_Orientation_SizeChange()
Assert.AreEqual(Orientation.Horizontal, sut.Orientation);
}
}
#endif

[TestClass]
[RunsOnUIThread]
Expand Down Expand Up @@ -207,3 +206,4 @@ public async Task Setup_And_Teardown()
}
}
}
#endif

0 comments on commit cda836c

Please sign in to comment.