Пример #1
0
        public void GivenDAInvalidValue_WhenValidating_ThenShouldThrows(string value)
        {
            DicomDate element = new DicomDate(DicomTag.Date, value);
            var       ex      = Assert.Throws <ElementValidationException>(() => _validation.Validate(element));

            Assert.Equal(ValidationErrorCode.DateIsInvalid, ex.ErrorCode);
        }
        public void WhenHasDateInStartOfWordIsWeak()
        {
            var word = "251190murilo";

            var result = _dateValidation.Validate(word);

            Assert.AreEqual((int)result, (int)ValidationType.Weak);
        }
Пример #3
0
        public void HandleExceptionForInvalidDate_TC11(string date)
        {
            string[] dates = date.Split(",");

            try
            {
                string[] days = DateValidation.Validate(dates);
            }
            catch (HotelCustomException e)
            {
                Console.WriteLine(e.Message);
            }
        }
Пример #4
0
        public void FindCheapestAndBestHotelForGivenDate_TC6()
        {
            string[] date = "11Sep2020,12Sep2020".Split(",");

            string expectedHotel = "Bridgewood";

            int expectedRate = 200;

            string actualHotel = "";

            int actualRate = 0;

            try
            {
                HotelReservation reservation = new HotelReservation();

                string[] days = DateValidation.Validate(date);

                Dictionary <string, int> hotel = reservation.FindCheapestRatesAndBestRatingHotel("Regular", date);

                foreach (KeyValuePair <string, int> kv in hotel)
                {
                    actualHotel = kv.Key;

                    actualRate = kv.Value;
                }

                Assert.AreEqual(expectedHotel, actualHotel);

                Assert.AreEqual(expectedRate, actualRate);
            }
            catch (HotelCustomException e)
            {
                Console.WriteLine(e.Message);
            }
        }