예제 #1
0
        public void CheckForInvalidDate_EnterADateThatDoesNotExist_ResultIsFalse()
        {
            //Arrange
            var year   = 2018;
            var month  = 11;
            var day    = 31;
            var result = false;

            //Act
            try
            {
                //The method CheckForInvalidDate has a void return type and throws a InvalidDateException when the date is invalid
                InputValidation.CheckForInvalidDate(year, month, day);
                result = true;
            }
            catch (InvalidDateException e)
            {
                result = false;
            }

            //Assert
            Assert.False(result);
        }