public void Test_PricePerNight_MeetsExpectation()
        {
            ABM.BOL.IABCBookingHelper IABC = new ABM.BOL.ABCBookingHelper();

            long    booking_id            = 200123;
            decimal expectedPricePerNight = 233.74M;
            decimal actualPricePerNight   = IABC.Get_PricePerNight_For_BookingId(booking_id);

            Assert.AreEqual(expectedPricePerNight, actualPricePerNight, "Price per night not met to the expected price for the given booking id.");
        }
        public void Test_PricePerNight_IsValid()
        {
            ABM.BOL.IABCBookingHelper IABC = new ABM.BOL.ABCBookingHelper();

            long    booking_id            = 250000;
            decimal expectedPricePerNight = 0M;
            decimal actualPricePerNight   = IABC.Get_PricePerNight_For_BookingId(booking_id);

            Assert.AreNotEqual(expectedPricePerNight, actualPricePerNight, "Price per night not found for the given booking id.");
        }
Exemple #3
0
        static void Main(string[] args)
        {
            string errorMsg = string.Empty;

            try
            {
                ABM.BOL.IABCBookingHelper IABC = new ABM.BOL.ABCBookingHelper();

                // (1) Get price per night
                long booking_id    = 200123;
                var  pricePerNight = IABC.Get_PricePerNight_For_BookingId(booking_id);
                Console.WriteLine(ABM.Constants.request1 + booking_id + " = " + pricePerNight);

                // (2) Get earliest check-in date
                long hotel_id            = 1042;
                var  earliestCheckInDate = IABC.Get_Earliest_CheckInDate_For_HotelId(hotel_id);
                Console.WriteLine(ABM.Constants.request2 + hotel_id + " = " + earliestCheckInDate);

                // (3) Get top 5 expensive bookings
                var top5_BookingIdWithTotalPrice = IABC.Get_FiveMostExpensiveBookings();
                Console.WriteLine(ABM.Constants.request3);
                foreach (var item in top5_BookingIdWithTotalPrice)
                {
                    Console.WriteLine(item.Key + " : " + item.Value);
                }

                // (4) Get total tax ABC owes
                decimal totalTax = IABC.Get_TotalTax_For_TheSystem();
                Console.WriteLine(ABM.Constants.request4 + totalTax);
            }
            catch (Exception ex)
            {
                errorMsg = ABM.Constants.COMMON_EXP + ex.Message;
            }
            finally
            {
                Console.WriteLine(errorMsg);
            }
            Console.ReadLine();
        }