diff --git a/tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/Navigation/NavigationTests.cs b/tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/Navigation/NavigationTests.cs index ae06e5adf..904282884 100644 --- a/tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/Navigation/NavigationTests.cs +++ b/tests/Maui/Prism.DryIoc.Maui.Tests/Fixtures/Navigation/NavigationTests.cs @@ -230,19 +230,18 @@ public async Task RelativeNavigation_RemovesPage_AndNavigatesModally() Assert.Null(startupEx); var window = GetWindow(mauiApp); - var rootPage = window.Page as MockViewA; - Assert.NotNull(rootPage); - TestPage(rootPage); - var currentPage = rootPage.Navigation.ModalStack.Last(); + Assert.IsType(window.Page); + TestPage(window.Page); + var currentPage = window.CurrentPage; Assert.IsType(currentPage); TestPage(currentPage); - var container = currentPage.GetContainerProvider(); - var navService = container.Resolve(); - Assert.Equal(2, rootPage.Navigation.ModalStack.Count); - await navService.NavigateAsync("../MockViewC"); - var viewC = window.Page.Navigation.ModalStack.Last(); - Assert.IsType(viewC); - Assert.Equal(2, rootPage.Navigation.ModalStack.Count); + var navService = Prism.Navigation.Xaml.Navigation.GetNavigationService(currentPage); + Assert.Single(window.Page.Navigation.ModalStack); + var result = await navService.NavigateAsync("../MockViewC"); + Assert.True(result.Success); + Assert.Null(result.Exception); + Assert.IsType(window.CurrentPage); + Assert.Single(window.Page.Navigation.ModalStack); } [Fact]