Exemple #1
0
        public void Setup()

        {
            MockForms.Init();
            selectedCitySite = new CitySite()
            {
                CitySiteID             = 1,
                CitySiteAddress        = "Test Address 1",
                CitySiteCategoryID     = 1,
                CitySiteCost           = "10 EUR",
                CitySiteDescription    = "Test Description",
                CitySiteFavourite      = true,
                CitySiteImageURL       = "http://testurl/url1.jpg",
                CitySiteMapCoordinates = "100,100",
                CitySiteName           = "test site one",
                ChildDetail            = "test child detail",
                CitySiteSubtext        = "test subtext",
                CitySiteTelephone      = "123456789",
                CitySiteWebSite        = "testURL",
                DisabilityDetail       = "disability detail test",
                TransportID            = 2,
                NeighbourhoodID        = 1
            };



            Mock <INavigation> mockNav = new Mock <INavigation>();

            cityVM = new CitySiteViewModel(mockNav.Object, true);
            cityVM.SetDetails(selectedCitySite);
        }
Exemple #2
0
        public void AddToFavourites(int id, bool isAdd)
        {
            CitySite mySite = ctx.CitySites.Where(a => a.CitySiteID == id).FirstOrDefault();

            if (isAdd == false)
            {
                mySite.CitySiteFavourite = false;
            }
            else
            {
                mySite.CitySiteFavourite = true;
            }

            ctx.SaveChanges();
        }
        public void addSites()
        {
            CitySite citySite = new CitySite()
            {
                CitySiteID             = 1,
                CitySiteAddress        = "Test Address 1",
                CitySiteCategoryID     = 1,
                CitySiteCost           = "10 EUR",
                CitySiteDescription    = "Test Description",
                CitySiteFavourite      = true,
                CitySiteImageURL       = "http://testurl/url1.jpg",
                CitySiteMapCoordinates = "100,100",
                CitySiteName           = "test site one",
                ChildDetail            = "test child detail",
                CitySiteSubtext        = "test subtext",
                CitySiteTelephone      = "123456789",
                CitySiteWebSite        = "testURL",
                DisabilityDetail       = "disability detail test",
                TransportID            = 2,
                NeighbourhoodID        = 1
            };

            allSites.Add(citySite);

            CitySite citySite2 = new CitySite()
            {
                CitySiteID       = 2,
                DisabilityAccess = true
            };

            allSites.Add(citySite2);
            CitySite citySite3 = new CitySite()
            {
                CitySiteID    = 3,
                ChildFriendly = true
            };

            allSites.Add(citySite3);
        }
        public void SetDetails(CitySite city)
        {
            CitySiteID             = city.CitySiteID;
            CitySiteName           = city.CitySiteName;
            CitySiteSubtext        = city.CitySiteSubtext;
            CitySiteCost           = city.CitySiteCost;
            CitySiteAddress        = city.CitySiteAddress;
            CitySiteWebSite        = city.CitySiteWebSite;
            CitySiteTelephone      = city.CitySiteTelephone;
            CitySiteCategoryID     = city.CitySiteCategoryID;
            CitySiteDescription    = city.CitySiteDescription;
            CitySiteMapCoordinates = city.CitySiteMapCoordinates;
            DisabilityAccess       = city.DisabilityAccess;
            ChildFriendly          = city.ChildFriendly;
            ChildDetail            = city.ChildDetail;
            DisabilityDetail       = city.DisabilityDetail;

            CitySiteImageURL  = city.CitySiteImageURL;
            CitySiteFavourite = city.CitySiteFavourite;
            NeighbourhoodID   = city.NeighbourhoodID;
            TransportID       = city.TransportID;
        }