Пример #1
0
        public void ThrowingCustomException_WhenPassedInvalidCustomerType()
        {
            //getting data
            string[] customerTypeAnddates = { "invalid", "11September2020", "12September2020" };
            HotelReservationCustomExceptions customException = Assert.Throws <HotelReservationCustomExceptions>(() => hotelReservation.AddingHotelsInList(customerTypeAnddates[0]));

            //assert
            Assert.AreEqual(customException.type, HotelReservationCustomExceptions.ExceptionType.INVALID_CUSTOMER_TYPE);
        }
Пример #2
0
        public void ThrowingCustomException_WhenPassedInvalidDate()
        {
            //adding data
            string[] customerTypeAnddates = { "Rewards", "11September2020", "12Sep2020" };
            hotelReservation.AddingHotelsInList(customerTypeAnddates[0]);
            //getting exception
            HotelReservationCustomExceptions customException = Assert.Throws <HotelReservationCustomExceptions>(() => hotelReservation.AddingDatesInList(customerTypeAnddates));

            //assert
            Assert.AreEqual(customException.type, HotelReservationCustomExceptions.ExceptionType.INVALID_DATE);
        }