public void DepartureCity_returns_Seattle() { DepartureCity result = DepartureCity.Find(1); string finalResult = result.GetDepartureCity(); Assert.AreEqual("Seattle", finalResult); }
public ActionResult AddDepartureToArrival(int departureId) { ArrivalCity arrival = ArrivalCity.Find(departureId); DepartureCity departure = DepartureCity.Find(Int32.Parse(Request.Form["departure-id"])); arrival.SetDepartures(departure); //Want to run the join table method return(RedirectToAction("ViewArrivals", new { id = departureId })); }
public ActionResult AddArrivalToDeparture(int arrivalId) { DepartureCity departure = DepartureCity.Find(arrivalId); ArrivalCity arrival = ArrivalCity.Find(Int32.Parse(Request.Form["arrival-id"])); departure.SetArrivals(arrival); //Want to run the join table method return(RedirectToAction("ViewDepartures", new { id = arrivalId })); }
public void DepartureCityId_returns_all_ArrivalId() { DepartureCity result = DepartureCity.Find(9); int finalResult = result.GetArrivals()[0].GetId(); Console.WriteLine(finalResult); Assert.AreEqual(1, finalResult); }
public ActionResult ViewDepartures(int id) { Dictionary <string, object> model = new Dictionary <string, object>(); DepartureCity selectedDepartureCity = DepartureCity.Find(id); List <ArrivalCity> flights = selectedDepartureCity.GetArrivals(); List <ArrivalCity> allArrivals = ArrivalCity.GetAll(); model.Add("selectedDepartureCity", selectedDepartureCity); model.Add("flights", flights); model.Add("allArrivals", allArrivals); return(View(model)); }