public async Task NavigateToAddListPageTest() { var vm = new HomePageViewModel(); vm.NewRandomizerListCommand.Should().NotBeNull(); await vm.NewListButtonPressed(); Container.Resolve <INavigationService>().GetCurrentPage().GetType().Should().Be(typeof(ListEditionPage)); }
private async Task HomePageViewModelTestListsAreNotEmptyAfteradd() { var vm = new HomePageViewModel(); await vm.NewListButtonPressed(); Container.Resolve <INavigationService>().GetCurrentPage().GetType().Should().Be(typeof(ListEditionPage)); var listEdPage = Container.Resolve <INavigationService>().GetCurrentPage(); var listEdVm = listEdPage.BindingContext as ListEditionPageViewModel; }
private async Task ListEditIsNewWhenAddingList() { var vm = new HomePageViewModel(); await vm.NewListButtonPressed(); var listEdPage = Container.Resolve <INavigationService>().GetCurrentPage(); var listEdVm = listEdPage.BindingContext as ListEditionPageViewModel; Container.Resolve <INavigationService>().GetCurrentPage().GetType().Should().Be(typeof(ListEditionPage)); listEdVm.IsNew.Should().BeTrue(); listEdVm.Title.Should().Be(TextResources.NewListPageTitle); }
private async Task ModifyNameOfNewListAndSave() { var vm = new HomePageViewModel(); await vm.NewListButtonPressed(); var listEdPage = Container.Resolve <INavigationService>().GetCurrentPage(); var listEdVm = listEdPage.BindingContext as ListEditionPageViewModel; listEdVm.IsNewParam = "true"; listEdVm.IsNew.Should().BeTrue(); listEdVm.ListVM.Name = "Beers"; await listEdVm.SaveList(); Container.Resolve <ListsManagerVM>().ListsVM.Should().Contain(listEdVm.ListVM); }
private async Task SaveNewListWithNoData() { var vm = new HomePageViewModel(); await vm.NewListButtonPressed(); var listEdPage = Container.Resolve <INavigationService>().GetCurrentPage(); var listEdVm = listEdPage.BindingContext as ListEditionPageViewModel; listEdVm.IsNewParam = "true"; listEdVm.IsNew.Should().BeTrue(); listEdVm.ListVM.Name = string.Empty; await listEdVm.SaveListCommand.ExecuteAsync(); Container.Resolve <ListsManagerVM>().ListsVM.Should().BeEmpty(); }