public void RemoveHiddenPageFromStack() { Assume.That(navController.MainStack.Count == 2); Assume.That(navController.ModalStack.Count == 2); Assume.That( navController.MainStack .GetCurrentPage() is TestPage1); Assume.That( navController.MainStack .GetPreviousPage() is TestPage0); navController.RemovePreviousPageFromMainStack(); Assert.Multiple(() => { Assert.IsTrue(navController.ModalStack.Count == 2); Assert.IsTrue(navController.MainStack.Count == 1); Assert.IsInstanceOf <TestPage1>( navController.MainStack .GetCurrentPage()); Assert.IsNull( navController.MainStack .GetPreviousPage()); }); }
public async Task RemovePreviousPageFromMainStack_removes_previous_page() { await navController.PushAsync <TestViewModel1>(); await navController.PushAsync <TestViewModel2>(); await navController.PushAsync <TestViewModel3>(); Assume.That(navController.MainStack.Count == 4); Assume.That(navController.MainStack.GetPreviousPage() is TestPage2); navController.RemovePreviousPageFromMainStack(); Assert.Multiple(() => { Assert.AreEqual(3, navController.MainStack.Count); Assert.IsInstanceOf <TestPage1>(navController.MainStack.GetPreviousPage()); }); }
public void RemoveHiddenPageFromStack() { Assume.That(navController.HiddenPage is TestPage2); navController.RemovePreviousPageFromMainStack(); Assert.Multiple(() => { Assert.IsTrue(navController.MainStack.Count == 3); Assert.IsInstanceOf <TestPage1>(navController.HiddenPage); }); }