public void ShouldShowReservationByTheDate_returnOneRow() { DateTime dateTime = new DateTime(2020, 7, 13); List <VReservation> result = vspecreservation.ReservationByDa(dateTime); var target = fake_vreservation.AllReservation(); Assert.AreEqual(target.FirstOrDefault().reservation_date.ToShortDateString(), result.FirstOrDefault().reservation_date.ToShortDateString()); }
public List <VReservation> ReservationByDa(DateTime day) { if (!allReservations.AllReservation().Any(x => x.reservation_date.ToShortDateString() == day.ToShortDateString())) { return(allReservations.EmptyReservation()); } var result = allReservations. AllReservation() .Where(x => x.reservation_date.ToShortDateString() == day.ToShortDateString()).ToList(); return(result); }