Example #1
0
        public void DoesValidateDatesThrowsExceptionWhenArgsAreNotValid()
        {
            //Arrange
            string[] testArgs = { "11.11.2000", "35.35.2005" };
            var      expectedExceptionType = new InvalidDateFormat().GetType();

            //Assert
            Assert.Throws(expectedExceptionType, () => _dateRangerFactory.ValidateDates(testArgs[0], testArgs[1]));
        }
Example #2
0
        public void DoesValidateDatesThrowsExceptionWhenDateCantBeParsed()
        {
            //Arrange
            const string invalidDate           = "35.36.37";
            const string validDate             = "12.12.2001";
            var          expectedExceptionType = new InvalidDateFormat().GetType();

            //Assert
            Assert.Throws(expectedExceptionType, () => _dateRangerFactory.ValidateDates(invalidDate, validDate));
        }
Example #3
0
        public void DoesValidateDatesThrowsExceptionWhenUserInputIsInvalid()
        {
            //Arrange
            string[] dates = { "11.11.2000", "12.35.2002" };
            var      expectedExceptionType = new InvalidDateFormat().GetType();

            _mockedUtils.Setup(x => x.GetUserDates(out dates));
            _mockedUtils.Object.GetUserDates(out dates);

            //Assert
            Assert.Throws(expectedExceptionType, () => _dateRangerFactory.ValidateDates(dates[0], dates[1]));
        }