public void TestCityEventRepositoryReturnsFilteredChildList()
        {
            CityEventRepository rep = new CityEventRepository(_ctx);
            var item = rep.GetAllCityEventsFiltered(null, true).FirstOrDefault();

            Assert.IsTrue(item.CityEventName == "TestEventTwoChildFriendly");
        }
        public void TestCityEventRepositoryReturnsFilteredDisabilityList()
        {
            CityEventRepository rep = new CityEventRepository(_ctx);
            var item = rep.GetAllCityEventsFiltered(true, null).FirstOrDefault();

            Assert.IsTrue(item.CityEventName == "TestEventOneDisabilityAccess");
        }
        public void TestCityEventRepositoryReturnsCorrectCount()
        {
            int CorrectCount = 2;

            CityEventRepository rep = new CityEventRepository(_ctx);


            Assert.IsTrue(rep.GetAllCityEvents().Count == CorrectCount);
        }
        public void SetFavouriteFilter(CityEventRepository repository, bool?connected = null)
        {
            if (isFavourite == null)
            {
                isFavourite = true;
            }
            else
            {
                isFavourite = null;
            }

            setFilters(repository, connected);
            NotifyOnPropertyChanged("isFavourite");
        }
        public void SetChildFilter(CityEventRepository repository, bool?connected = null)
        {
            if (isChildFriendly == null)
            {
                isChildFriendly = true;
            }
            else
            {
                isChildFriendly = null;
            }

            setFilters(repository, connected);
            NotifyOnPropertyChanged("isChildFriendly");
        }
        public void SetDisabledFilter(CityEventRepository repository, bool?connected = null)
        {
            if (isDIsabled == null)
            {
                isDIsabled = true;
            }
            else
            {
                isDIsabled = null;
            }

            setFilters(repository, connected);

            NotifyOnPropertyChanged("isDIsabled");
        }
        public CityEventViewModel(INavigation navigation, bool?connectLive)
        {
            Navigation       = navigation;
            repository       = new CityEventRepository(new CityDBContext());
            neighbourrepo    = new NeighbourhoodRepository();
            reviewRepository = new CityReviewRepository();

            if (connectLive.HasValue)
            {
                isOnline = (bool)connectLive;
            }
            else
            {
                isOnline = isConnected();
            }
        }
        public void setFilters(CityEventRepository repository, bool?connected = null)
        {
            SetCityEvents(this.setListOfEvents(repository), connected);

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

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

            if (isFavourite.HasValue == true)
            {
                allCityEvents = allCityEvents.Where(c => c.CityEventFavourite == isFavourite).ToList();
            }


            NotifyOnPropertyChanged(nameof(allCityEvents));
        }
 public CityEvent getCityDetail(int ceID, CityEventRepository repo)
 {
     return(repo.GetAllCityEvents()
            .Where(a => a.CityEventID == ceID).FirstOrDefault());
 }
 public List <CityEvent> setListOfEvents(CityEventRepository repo)
 {
     return(repo.GetAllCityEvents());
 }
 public CityEventsListViewModel(INavigation navigation)
 {
     Navigation         = navigation;
     eventRepository    = new CityEventRepository(new CityDBContext());
     _selectedCityEvent = null;
 }