public void Setup() { MockForms.Init(); selectedCityMuseum = new CityMuseum() { CityMuseumID = 1, CityMuseumAddress = "Test Address 1", CityMuseumCategoryID = 1, CityMuseumCost = "10 EUR", CityMuseumDescription = "Test Description", CityMuseumFavourite = true, CityMuseumImageURL = "http://testurl/url1.jpg", CityMuseumMapCoordinates = "100,100", CityMuseumName = "test museum one", ChildDetail = "test child detail", CityMuseumSubtext = "test subtext", CityMuseumTelephone = "123456789", CityMuseumWebSite = "testURL", DisabilityDetail = "disability detail test", TransportID = 2, NeighbourhoodID = 1 }; Mock <INavigation> mockNav = new Mock <INavigation>(); cityVM = new CityMuseumViewModel(mockNav.Object, true); cityVM.SetDetails(selectedCityMuseum); }
public void AddToFavourites(int id, bool isAdd) { CityMuseum mySite = ctx.CityMuseums.Where(a => a.CityMuseumID == id).FirstOrDefault(); if (isAdd == false) { mySite.CityMuseumFavourite = false; } else { mySite.CityMuseumFavourite = true; } ctx.SaveChanges(); }
public void SetDetails(CityMuseum museum) { CityMuseumID = museum.CityMuseumID; CityMuseumName = museum.CityMuseumName; CityMuseumSubtext = museum.CityMuseumSubtext; CityMuseumCost = museum.CityMuseumCost; CityMuseumAddress = museum.CityMuseumAddress; CityMuseumWebSite = museum.CityMuseumWebSite; CityMuseumTelephone = museum.CityMuseumTelephone; CityMuseumCategoryID = museum.CityMuseumCategoryID; CityMuseumDescription = museum.CityMuseumDescription; CityMuseumMapCoordinates = museum.CityMuseumMapCoordinates; DisabilityAccess = museum.DisabilityAccess; ChildFriendly = museum.ChildFriendly; ChildDetail = museum.ChildDetail; DisabilityDetail = museum.DisabilityDetail; CityMuseumImageURL = museum.CityMuseumImageURL; CityMuseumFavourite = museum.CityMuseumFavourite; NeighbourhoodID = museum.NeighbourhoodID; CityMuseumID = museum.CityMuseumID; TransportID = museum.TransportID; }
public void addMuseums() { CityMuseum CityMuseum = new CityMuseum() { CityMuseumID = 1, CityMuseumAddress = "Test Address 1", CityMuseumCategoryID = 1, CityMuseumCost = "10 EUR", CityMuseumDescription = "Test Description", CityMuseumFavourite = true, CityMuseumImageURL = "http://testurl/url1.jpg", CityMuseumMapCoordinates = "100,100", CityMuseumName = "test site one", ChildDetail = "test child detail", CityMuseumSubtext = "test subtext", CityMuseumTelephone = "123456789", CityMuseumWebSite = "testURL", DisabilityDetail = "disability detail test", TransportID = 2, NeighbourhoodID = 1 }; allMuseums.Add(CityMuseum); CityMuseum CityMuseum2 = new CityMuseum() { CityMuseumID = 2, DisabilityAccess = true }; allMuseums.Add(CityMuseum2); CityMuseum CityMuseum3 = new CityMuseum() { CityMuseumID = 3, ChildFriendly = true }; allMuseums.Add(CityMuseum3); }