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 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); }