Esempio n. 1
0
        public async Task NavigateToAddListPageTest()
        {
            var vm = new HomePageViewModel();

            vm.NewRandomizerListCommand.Should().NotBeNull();
            await vm.NewListButtonPressed();

            Container.Resolve <INavigationService>().GetCurrentPage().GetType().Should().Be(typeof(ListEditionPage));
        }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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();
        }