Skip to content

Commit

Permalink
chore: refactor test
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Apr 7, 2024
1 parent 9f603bd commit 64a41f6
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<MockViewA>(window.Page);
TestPage(window.Page);
var currentPage = window.CurrentPage;
Assert.IsType<MockViewB>(currentPage);
TestPage(currentPage);
var container = currentPage.GetContainerProvider();
var navService = container.Resolve<INavigationService>();
Assert.Equal(2, rootPage.Navigation.ModalStack.Count);
await navService.NavigateAsync("../MockViewC");
var viewC = window.Page.Navigation.ModalStack.Last();
Assert.IsType<MockViewC>(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<MockViewC>(window.CurrentPage);
Assert.Single(window.Page.Navigation.ModalStack);
}

[Fact]
Expand Down

0 comments on commit 64a41f6

Please sign in to comment.