public void getLocationsForFilmTest() { LocationFinderController target = new LocationFinderController(); // TODO: Initialize to an appropriate value String filmName; LocationListUI expected, actual; filmName = "12 Angry Men"; expected = new LocationListUI(); expected.filmName = filmName; expected.locations = new List<String>(); expected.locations.Add ("New York County Courthouse<br>40 Foley Square<br>Lower Manhattan"); actual = target.getLocationsForFilm(filmName); Assert.AreEqual(expected, actual); filmName = "15 Minutes"; expected = new LocationListUI(); expected.filmName = filmName; expected.locations = new List<String>(); expected.locations.Add("E. 60-66th St.and Madison Ave.<br>Upper East Side<br>Manhattan"); actual = target.getLocationsForFilm(filmName); Assert.AreEqual(expected, actual); filmName = "25th Hour"; expected = new LocationListUI(); expected.filmName = filmName; expected.locations = new List<String>(); expected.locations.Add("World Trade Center<br>Lower Manhattan"); expected.locations.Add("Carl Schurz Park<br>Upper East Side<br>Manhattan"); actual = target.getLocationsForFilm(filmName); Assert.AreEqual(expected, actual); }
public LocationListUI getLocationsForFilm(String filmName) { LocationListUI locations = new LocationListUI(); List<String> locationNames = new List<string>(); List<Location> allLocations = fdal.findLocationsByFilm(filmName); if (allLocations != null && allLocations.Count > 0) { for (int i = 0; i < allLocations.Count; i++) { locationNames.Add(allLocations[i].locnText); } } locations.filmName = filmName; locations.locations = locationNames; return locations; }
public void getLocationsForFilmTest() { LocationFinder target = new LocationFinder(); String filmName; LocationListUI expected, actual; filmName = "12 Angry Men"; expected = new LocationListUI(); expected.filmName = filmName; expected.locations = new List<String>(); expected.locations.Add ("New York County Courthouse<br>40 Foley Square<br>Lower Manhattan"); actual = target.getLocationsForFilm(filmName); Assert.AreEqual(expected, actual); filmName = "15 Minutes"; expected = new LocationListUI(); expected.filmName = filmName; expected.locations = new List<String>(); expected.locations.Add("E. 60-66th St.and Madison Ave.<br>Upper East Side<br>Manhattan"); expected.locations.Add("Carl Schurz Park<br>Upper East Side<br>Manhattan"); actual = target.getLocationsForFilm(filmName); Assert.AreEqual(expected, actual); }