public async Task OnAppearing_runs_after_PopAsync(bool isAnimated) { await navController.PushAsync <TestViewModel1>(); await navController.PushAsync <TestViewModel2>(); await navController.PopAsync(isAnimated); Assume.That(navController.TopViewModel is TestViewModel1); var vm = navController.TopViewModel as TestViewModel1; Assert.IsTrue(vm.OnAppearingRuns == 2); }
public async Task OnAppearing_doesnt_runs_after_PopAsync_if_modal(bool isAnimated) { navController = new NavController(); await navController.InitAsync(new TestPage1()); await navController.PushAsync <TestViewModel2>(); await navController.PushModalAsync <TestViewModel3>(); await navController.PopAsync(isAnimated); var vm = navController.MainStack.GetCurrentViewModel(); Assume.That(vm is TestViewModel1); Assert.AreEqual(1, (vm as TestViewModel1).OnAppearingRuns); }
public void NotInitializedException_PopAsync() { Assert.ThrowsAsync <NotInitializedException>(async() => { await navController.PopAsync(); }); }