public async void NavigateAsync_ToContentPage_ThenGoBack() { var pageMock = new ContentPageMock(); var navigationService = new PageNavigationServiceMock(_container, _applicationProvider, _loggerFacade); ((IPageAware)navigationService).Page = pageMock; var rootPage = new NavigationPage(pageMock); Assert.IsType(typeof(ContentPageMock), rootPage.CurrentPage); await navigationService.NavigateAsync("TabbedPage"); Assert.True(rootPage.Navigation.NavigationStack.Count == 2); Assert.IsType(typeof(TabbedPageMock), rootPage.CurrentPage); await navigationService.GoBackAsync(); Assert.True(rootPage.Navigation.NavigationStack.Count == 1); Assert.IsType(typeof(ContentPageMock), rootPage.CurrentPage); }
public async void Navigate_ToContentPage_ThenGoBack() { var navigationService = new PageNavigationServiceMock(_container, _applicationProvider, _loggerFacade); var rootPage = new Xamarin.Forms.ContentPage(); ((IPageAware)navigationService).Page = rootPage; await navigationService.NavigateAsync("ContentPage"); Assert.True(rootPage.Navigation.ModalStack.Count == 1); Assert.IsType(typeof(ContentPageMock), rootPage.Navigation.ModalStack[0]); await navigationService.GoBackAsync(); Assert.True(rootPage.Navigation.ModalStack.Count == 0); }