private void RemoveJourneys(Booking booking) { foreach (var journey in booking.Journeys.ToList()) { _JourneyRepository.Delete(journey); } }
[Ignore]//Execute in controlled conditions. Need data in database to complete successfuly. public void DeleteTest() { var booking = _BookingRepository.FirstOrDefault(x => x.Id > 0, trackingEnabled); _BookingRepository.Delete(booking.Id); var deleted = Sut.Save(); Assert.IsTrue(deleted == 1); }