public async Task PushingSetsCorrectNavigationSource() { var shell = new TestShell(CreateShellItem(shellItemRoute: "item1")); shell.RegisterPage(nameof(PushingSetsCorrectNavigationSource)); await shell.GoToAsync(nameof(PushingSetsCorrectNavigationSource)); shell.TestNavigatingArgs(ShellNavigationSource.Push, "//item1", $"{nameof(PushingSetsCorrectNavigationSource)}"); shell.TestNavigatedArgs(ShellNavigationSource.Push, "//item1", $"//item1/{nameof(PushingSetsCorrectNavigationSource)}"); }
public async Task PoppingSamePageSetsCorrectNavigationSource() { Routing.RegisterRoute("detailspage", typeof(ContentPage)); var shell = new TestShell(CreateShellItem(shellItemRoute: "item1")); await shell.GoToAsync("detailspage/detailspage"); await shell.Navigation.PopAsync(); shell.TestNavigatingArgs(ShellNavigationSource.Pop, "//item1/detailspage/detailspage", $".."); shell.TestNavigatedArgs(ShellNavigationSource.Pop, "//item1/detailspage/detailspage", $"//item1/detailspage"); }
public async Task PoppingSetsCorrectNavigationSource() { var shell = new TestShell(CreateShellItem(shellContentRoute: "item1")); shell.RegisterPage("page1"); shell.RegisterPage("page2"); await shell.GoToAsync("page1"); await shell.GoToAsync("page2"); await shell.Navigation.PopAsync(); shell.TestNavigatingArgs(ShellNavigationSource.Pop, "//item1/page1/page2", $".."); shell.TestNavigatedArgs(ShellNavigationSource.Pop, "//item1/page1/page2", $"//item1/page1"); }