public async Task OnBackbuttonPressedPageReturnsFalse() { TestShell shell = new TestShell(); Routing.RegisterRoute("OnBackbuttonPressedFiresOnPage", typeof(ShellTestPage)); shell.Items.Add(CreateShellItem()); await shell.GoToAsync($"OnBackbuttonPressedFiresOnPage?CancelNavigationOnBackButtonPressed=false"); shell.SendBackButtonPressed(); Assert.AreEqual(1, shell.Navigation.NavigationStack.Count); }
public async Task OnBackbuttonPressedShellReturnsTrue() { TestShell shell = new TestShell(); Routing.RegisterRoute("OnBackbuttonPressedShellReturnsTrue", typeof(ShellTestPage)); shell.Items.Add(CreateShellItem()); await shell.GoToAsync($"OnBackbuttonPressedShellReturnsTrue"); shell.OnBackButtonPressedFunc = () => true; shell.SendBackButtonPressed(); Assert.AreEqual(2, shell.Navigation.NavigationStack.Count); }