public void Apply(Navigator navigator, ScreenStack screens) { if (screens.IsRoot) { return; } screens.Clear(); navigator.BackToRoot(); }
public void ClearEmptyStackScreen() { // - Arrange var rootScreen = new Mock <Screen>().Object; var screenStack = new ScreenStack(); // - Act screenStack.Clear(); // - Assert Assert.IsTrue(screenStack.IsRoot); Assert.IsNull(screenStack.CurrentScreen); Assert.AreEqual(0, screenStack.Count); }
public void ClearStackWithOnlyRootScreen() { // - Arrange var rootScreen = new Mock <Screen>().Object; var screenStack = new ScreenStack(); screenStack.Push(rootScreen); // - Act screenStack.Clear(); // - Assert Assert.IsTrue(screenStack.IsRoot); Assert.AreEqual(rootScreen, screenStack.CurrentScreen); Assert.AreEqual(1, screenStack.Count); }
public void Reset() { ScreenStack.Clear(); ScreenStack.Push(new MainMenu(Context, this)); }