public void TestCityMuseumRepositoryReturnsFilteredChildList()
        {
            CityMuseumRepository rep = new CityMuseumRepository(_ctx);
            var item = rep.GetAllCityMuseumsFiltered(null, true).FirstOrDefault();

            Assert.IsTrue(item.CityMuseumName == "TestMuseumTwoChildFriendly");
        }
        public void TestCityMuseumRepositoryReturnsFilteredDisabilityList()
        {
            CityMuseumRepository rep = new CityMuseumRepository(_ctx);
            var item = rep.GetAllCityMuseumsFiltered(true, null).FirstOrDefault();

            Assert.IsTrue(item.CityMuseumName == "TestMuseumOneDisabilityAccess");
        }
        public void TestCityMuseumRepositoryReturnsCorrectCount()
        {
            int CorrectCount = 2;

            CityMuseumRepository rep = new CityMuseumRepository(_ctx);


            Assert.IsTrue(rep.GetAllCityMuseums().Count == CorrectCount);
        }
        public void SetFavouriteFilter(CityMuseumRepository repo, bool?IsConnected = null)
        {
            if (isFavourite == null)
            {
                isFavourite = true;
            }
            else
            {
                isFavourite = null;
            }

            setFilters(repo, IsConnected);
            NotifyOnPropertyChanged("isFavourite");
        }
        public void SetChildFilter(CityMuseumRepository repo, bool?IsConnected = null)
        {
            if (isChildFriendly == null)
            {
                isChildFriendly = true;
            }
            else
            {
                isChildFriendly = null;
            }

            setFilters(repo, IsConnected);
            NotifyOnPropertyChanged("isChildFriendly");
        }
 public CityMuseumViewModel(INavigation navigation, bool?IsConnected = null)
 {
     Navigation       = navigation;
     repository       = new CityMuseumRepository(new CityDBContext());
     neighbourrepo    = new NeighbourhoodRepository();
     reviewRepository = new CityReviewRepository();
     if (IsConnected != null)
     {
         isOnline = (bool)IsConnected;
     }
     else
     {
         isOnline = isConnected();
     }
 }
        public void SetDisabledFilter(CityMuseumRepository repo, bool?IsConnected = null)
        {
            if (isDIsabled == null)
            {
                isDIsabled = true;
            }
            else
            {
                isDIsabled = null;
            }

            setFilters(repo, IsConnected);

            NotifyOnPropertyChanged("isDIsabled");
        }
        public void setFilters(CityMuseumRepository repo, bool?isConn = null)
        {
            SetCityMuseums(this.returnCityMuseums(repo), isConn);

            if (isDIsabled.HasValue == true)
            {
                allCityMuseums = allCityMuseums.Where(b => b.DisabilityAccess == isDIsabled).ToList();
            }

            if (isChildFriendly.HasValue == true)
            {
                allCityMuseums = allCityMuseums.Where(c => c.ChildFriendly == isChildFriendly).ToList();
            }

            if (isFavourite.HasValue == true)
            {
                allCityMuseums = allCityMuseums.Where(c => c.CityMuseumFavourite == isFavourite).ToList();
            }


            NotifyOnPropertyChanged(nameof(allCityMuseums));
        }
 public CityMuseum getCityDetail(int ceID, CityMuseumRepository repo)
 {
     return(repo.GetAllCityMuseums()
            .Where(a => a.CityMuseumID == ceID).FirstOrDefault());
 }
 public CityMuseumsListViewModel(INavigation navigation)
 {
     Navigation          = navigation;
     _selectedCityMuseum = null;
     repository          = new CityMuseumRepository(new CityDBContext());
 }
 public List <CityMuseum> returnCityMuseums(CityMuseumRepository repo)
 {
     return(repo.GetAllCityMuseums().ToList());
 }