public async Task TestGetBookingFail() { BookingJson booking = new BookingJson(); var result = await booking.GetBookingsAsync(ConnString, "John", "Doe", DateTime.MinValue, "Hobart", "", null); Assert.IsTrue(result.Count == 0); }
public async Task TestGetBookingPass() { BookingJson booking = new BookingJson(); var result = await booking.GetBookingsAsync(ConnString, "John", "Doe", DateTime.MinValue, "Melbourne", "", null); Assert.IsNotNull(result); }
public async Task <JsonResult> SearchBooking(string fname, string lname, DateTime date, string arrcity, string depcity, string flightno) { try { BookingJson bookingJsonObj = new BookingJson(); var result = await bookingJsonObj.GetBookingsAsync(ConnectionString, fname, lname, date, arrcity, depcity, flightno); return(Json(result)); } catch { return(Json(null)); } }