public void ShouldBackFromDetailsCommandTakeYouBackToSelectedTabActive() { //arrange viewModel = new ContactViewModel(DataManager); //act viewModel.NavigationService.SetRootPage(nameof(DashboardPage), new DashboardViewModel()); viewModel.NavigationService.NavigateAsync(nameof(CustomTabbedPage), null, false); int selectedTab = 1; viewModel.Init(selectedTab); Task.Run(async() => { await viewModel.ExecuteBackFromDetailsCommandAsync(); }).GetAwaiter().GetResult(); //assert int currentTabIndex = viewModel.NavigationService.GetCurrentSelectedTabIndexOverMasterDetailPageWithTabbedPage(); Assert.AreEqual(selectedTab, currentTabIndex); }