public void SearchForParkReservations(string park) { DateTime today = System.DateTime.Now; DateTime futureMonthDate = today.AddMonths(1); ReservationSqlDAL reservationSqlDAL = new ReservationSqlDAL(); List <Reservation> reservations = new List <Reservation>(); reservations = reservationSqlDAL.GetParkReversations(park, today, futureMonthDate); if (reservations.Count != 0) { Console.WriteLine($"\nAll Reservations for {park}:"); Console.WriteLine("ID".PadRight(4) + "Site ID".PadRight(9) + "Name".PadRight(32) + "From Date".PadRight(12) + "To Date"); foreach (Reservation reservation in reservations) { Console.WriteLine( reservation.ReservationId.ToString().PadRight(4) + reservation.SiteID.ToString().PadRight(9) + reservation.Name.ToString().PadRight(32) + reservation.FromDate.ToString("d").PadRight(12) + reservation.ToDate.Date.ToString("d") ); } Console.WriteLine("\nPress <Enter> to continue!"); Console.ReadLine(); } else { Console.WriteLine($"No Reservations for {park}"); } }
public void GetParkReservationsTest() { string parkName = "Acadia"; DateTime currentDate = DateTime.MinValue; DateTime futureMonthDate = DateTime.MinValue; ReservationSqlDAL reservationSqlDAL = new ReservationSqlDAL(); List <Reservation> result = reservationSqlDAL.GetParkReversations(parkName, currentDate, futureMonthDate); Assert.IsNotNull(result); }