Ejemplo n.º 1
0
        public void Compare_WithinDateRange_ReturnsTrue(
            int year, int month, int day, int hour, int minute, string targetDate)
        {
            var dateToCheck = new DateTime(year, month, day, hour, minute, 00);

            Assert.True(DateComparer.IsDateTimeWithin(dateToCheck, targetDate));
        }
Ejemplo n.º 2
0
        public void Compare_WrongFormattedTargetDate_ThrowsFormatException(string targetDate)
        {
            DateTime dateTime = new DateTime(2013, 12, 04, 12, 30, 00);
            Action   actual   = () => DateComparer.IsDateTimeWithin(dateTime, targetDate);

            Assert.Throws <FormatException>(actual);
        }