public async Task SetNamingConventions_suffix_withDi() { NavController.SetNamingConventions(viewModelSuffix: "Vm", viewSuffix: "Pg"); navController = new NavController(); await navController.DiInitAsync(new DiTestVm0()); Assert.IsInstanceOf <DiTestPg0>(navController.RootPage); await navController.DiPushAsync(new DiTestVm0()); Assert.Multiple(() => { Assert.AreEqual(2, navController.MainStack.Count); Assert.IsInstanceOf <DiTestPg0>(navController.TopPage); }); }
public async Task SetNamingConventions_subNameSpace_and_suffix_withDi() { NavController.SetNamingConventions("Vms", "Pages", "Vm", "Pg"); navController = new NavController(); await navController.DiInitAsync(new Vms.DiTestVmsVm()); Assert.IsInstanceOf <Pages.DiTestVmsPg>(navController.RootPage); await navController.DiPushAsync(new Vms.DiTestVmsVm()); Assert.Multiple(() => { Assert.AreEqual(2, navController.MainStack.Count); Assert.IsInstanceOf <Pages.DiTestVmsPg>(navController.TopPage); }); }
public async Task RemovePageFor_works_with_Di_pages() { navController = new NavController(); await navController.DiInitAsync(new DiTestViewModel0()); await navController.DiPushAsync(new DiTestViewModel1()); await navController.DiPushAsync(new DiTestViewModel2()); await navController.DiPushAsync(new DiTestViewModel3()); Assume.That(navController.MainStack.Count == 4); Assume.That(navController.MainStack[1] is DiTestPage1); navController.RemovePageFor <DiTestViewModel1>(); Assert.Multiple(() => { Assert.AreEqual(3, navController.MainStack.Count); Assert.IsNotInstanceOf <DiTestPage1>(navController.MainStack[1]); }); }
public async Task DiInitAsync_Page_IsInitialized_True() { await navController.DiInitAsync(new DiTestViewModel0()); Assert.IsTrue(navController.IsInitialized); }
public async Task SetupOnce() { Xamarin.Forms.Mocks.MockForms.Init(); navController = new NavController(); await navController.DiInitAsync(new DiTestViewModel0()); }