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 TestFlightBookingFail() { BookingJson booking = new BookingJson(); var result = await booking.BookFlightAsync(ConnString, new BookingJson() { ArrCity = "Brisbane", DepartCity = null, BookDate = new DateTime(2018, 05, 21), FlightNo = "VA234", FirstName = "Roger", LastName = "Smith" }); }
public async Task <JsonResult> BookFlightAsync(BookingJson bookDetail) { try { BookingJson booking = new BookingJson(); var result = await booking.BookFlightAsync(ConnectionString, bookDetail); return(Json(result)); } catch { return(Json(null)); } }
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)); } }
public async Task TestFlightBookingPass() { BookingJson booking = new BookingJson(); var result = await booking.BookFlightAsync(ConnString, new BookingJson() { ArrCity = "Brisbane", DepartCity = "Perth", BookDate = new System.DateTime(2018, 5, 28), FlightNo = "VA234", FirstName = "Roger", LastName = "Smith" }); Assert.IsTrue(result); }