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 RemoveInnerPagesNavigatingArgs() { Routing.RegisterRoute("SecondPageView", typeof(ContentPage)); Routing.RegisterRoute("ThirdPageView", typeof(ContentPage)); Routing.RegisterRoute("FourthPage", typeof(ContentPage)); var shell = new TestShell(CreateShellItem <FlyoutItem>(shellContentRoute: "HomePageView")); await shell.GoToAsync("//HomePageView/SecondPageView/ThirdPageView"); await shell.GoToAsync("//HomePageView/FourthPage"); shell.TestNavigatedArgs(ShellNavigationSource.Pop, "//HomePageView/SecondPageView/ThirdPageView", "//HomePageView/FourthPage"); Assert.AreEqual(3, shell.NavigatedCount); }
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"); }