diff --git a/src/Uno.Toolkit.RuntimeTests/Tests/AncestorBindingTests.cs b/src/Uno.Toolkit.RuntimeTests/Tests/AncestorBindingTests.cs index 5d1c97027..2b7313735 100644 --- a/src/Uno.Toolkit.RuntimeTests/Tests/AncestorBindingTests.cs +++ b/src/Uno.Toolkit.RuntimeTests/Tests/AncestorBindingTests.cs @@ -30,7 +30,7 @@ public async Task Ancestor_TopLevel_PageBinding() var setup = new AncestorBindingTest(); await UnitTestUIContentHelperEx.SetContentAndWait(setup); - var sut = setup.FindFirstDescendant("TopLevelTextBlock") ?? throw new Exception("Failed to find TopLevelTextBlock"); + var sut = setup.GetFirstDescendant(x => x.Name == "TopLevelTextBlock") ?? throw new Exception("Failed to find TopLevelTextBlock"); Assert.AreEqual(sut.Text, setup.Tag); } @@ -40,9 +40,9 @@ public async Task Ancestor_Nested_PageBinding() var setup = new AncestorBindingTest(); await UnitTestUIContentHelperEx.SetContentAndWait(setup); - var lv = setup.FindFirstDescendant("TopLevelListView") ?? throw new Exception("Failed to find TopLevelListView"); + var lv = setup.GetFirstDescendant(x => x.Name == "TopLevelListView") ?? throw new Exception("Failed to find TopLevelListView"); var container = lv.ContainerFromIndex(0); - var sut = (container as FrameworkElement)?.FindFirstDescendant("NestedLvTextBlock1") ?? throw new Exception("Failed to find NestedLvTextBlock1"); + var sut = (container as FrameworkElement)?.GetFirstDescendant(x => x.Name == "NestedLvTextBlock1") ?? throw new Exception("Failed to find NestedLvTextBlock1"); Assert.AreEqual(sut.Text, setup.Tag); } @@ -53,9 +53,9 @@ public async Task Ancestor_Nested_LvBinding() var setup = new AncestorBindingTest(); await UnitTestUIContentHelperEx.SetContentAndWait(setup); - var lv = setup.FindFirstDescendant("TopLevelListView") ?? throw new Exception("Failed to find TopLevelListView"); + var lv = setup.GetFirstDescendant(x => x.Name == "TopLevelListView") ?? throw new Exception("Failed to find TopLevelListView"); var container = lv.ContainerFromIndex(0); - var sut = (container as FrameworkElement)?.FindFirstDescendant("NestedLvTextBlock2") ?? throw new Exception("Failed to find NestedLvTextBlock2"); + var sut = (container as FrameworkElement)?.GetFirstDescendant(x => x.Name == "NestedLvTextBlock2") ?? throw new Exception("Failed to find NestedLvTextBlock2"); Assert.AreEqual(sut.Text, lv.Tag); } } diff --git a/src/Uno.Toolkit.RuntimeTests/Tests/DrawerTests.cs b/src/Uno.Toolkit.RuntimeTests/Tests/DrawerTests.cs index 72f38f373..5ad4d5249 100644 --- a/src/Uno.Toolkit.RuntimeTests/Tests/DrawerTests.cs +++ b/src/Uno.Toolkit.RuntimeTests/Tests/DrawerTests.cs @@ -48,7 +48,7 @@ await Task.Run(async () => await UIHelper.WaitForIdle(); await UnitTestUIContentHelperEx.WaitFor(() => drawer.AnimationStoryboard?.GetCurrentState() == ClockState.Stopped); - var lightDismissOverlay = drawer.FindFirstDescendant(x => x.Name == DrawerControl.TemplateParts.LightDismissOverlayName) ?? + var lightDismissOverlay = drawer.GetFirstDescendant(x => x.Name == DrawerControl.TemplateParts.LightDismissOverlayName) ?? throw new Exception($"Failed to find {DrawerControl.TemplateParts.LightDismissOverlayName}"); await UnitTestUIContentHelperEx.WaitFor( diff --git a/src/Uno.Toolkit.RuntimeTests/Tests/ExtendedSplashScreenTests.cs b/src/Uno.Toolkit.RuntimeTests/Tests/ExtendedSplashScreenTests.cs index 6db342134..94e35bf16 100644 --- a/src/Uno.Toolkit.RuntimeTests/Tests/ExtendedSplashScreenTests.cs +++ b/src/Uno.Toolkit.RuntimeTests/Tests/ExtendedSplashScreenTests.cs @@ -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() ?? throw new Exception("Failed to find splash image control"); + var sut = host.GetFirstDescendant() ?? 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)); diff --git a/src/Uno.Toolkit.RuntimeTests/Tests/ResponsiveExtensionsTests.cs b/src/Uno.Toolkit.RuntimeTests/Tests/ResponsiveExtensionsTests.cs index 1119cb89c..b062d16c2 100644 --- a/src/Uno.Toolkit.RuntimeTests/Tests/ResponsiveExtensionsTests.cs +++ b/src/Uno.Toolkit.RuntimeTests/Tests/ResponsiveExtensionsTests.cs @@ -161,7 +161,6 @@ public async Task ProvideValue_Orientation_SizeChange() Assert.AreEqual(Orientation.Horizontal, sut.Orientation); } } -#endif [TestClass] [RunsOnUIThread] @@ -207,3 +206,4 @@ public async Task Setup_And_Teardown() } } } +#endif