Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public async Task TestGetBookingPass()
        {
            BookingJson booking = new BookingJson();
            var         result  = await booking.GetBookingsAsync(ConnString, "John", "Doe", DateTime.MinValue, "Melbourne", "", null);

            Assert.IsNotNull(result);
        }
Exemplo n.º 3
0
 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"
     });
 }
Exemplo n.º 4
0
        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));
            }
        }
Exemplo n.º 5
0
        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));
            }
        }
Exemplo n.º 6
0
        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);
        }