Skip to content

Commit

Permalink
added tabbed page test
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlagunas committed Feb 24, 2021
1 parent 095f898 commit e90a6f7
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,24 @@ public void TabbedPage_ContentPage_GetsCorrectNavService()
var correctPageNavService = ((IPageAware)vm.NavigationService).Page == view;
Assert.True(correctPageNavService);
}

[Fact]
public void TabbedPage_InNavigationPage_GetsCorrectNavService()
{
var app = CreateMockApplication();
app.NavigationService.NavigateAsync("NavigationPage/XamlTabbedViewMock");

var mainPage = app.MainPage;
Assert.IsType<NavigationPage>(mainPage);

var tp = mainPage.Navigation.NavigationStack[0] as TabbedPage;
Assert.NotNull(tp);

var tpVm = tp.BindingContext as XamlTabbedViewMockViewModel;
Assert.NotNull(tpVm);

var correctNavService = ((IPageAware)tpVm.NavigationService).Page == tp;
Assert.True(correctNavService);
}
}
}

0 comments on commit e90a6f7

Please sign in to comment.