public async Task OnAppearing_doesnt_run_after_CollapseMainStack_if_modal() { navController = new NavController(); await navController.InitAsync(new TestPage0()); await navController.PushAsync <TestViewModel1>(); await navController.PushModalAsync <TestViewModel2>(); await navController.CollapseMainStack(); Assume.That(navController.RootViewModel is TestViewModel1); var vm = navController.RootViewModel as TestViewModel1; Assert.AreEqual(1, vm.OnAppearingRuns); }
public async Task CollapseMainStack_results_in_TopPage_being_RootPage() { await navController.PushAsync <TestViewModel1>(); await navController.PushAsync <TestViewModel2>(); await navController.PushAsync <TestViewModel3>(); await navController.PushAsync <TestViewModel4>(); Assume.That(navController.MainStack.Count == 5); await navController.CollapseMainStack(); Assert.Multiple(() => { Assert.AreEqual(1, navController.MainStack.Count); Assert.IsInstanceOf <TestViewModel4>(navController.TopViewModel); Assert.AreEqual(navController.TopPage, navController.RootPage); }); }