Пример #1
0
        public void ShouldNotBeLeapYear(int number)
        {
            var cal    = new LeapYearCalculator();
            var result = cal.IsLeapYear(number);

            Assert.False(result);
        }
Пример #2
0
        public void IsLeapYear_returnsTrue_divisibleBy4_notBy100()
        {
            int yearToCheck = 2016;

            bool actualResult = LeapYearCalculator.IsLeapYear(yearToCheck);

            Assert.IsTrue(actualResult);
        }
Пример #3
0
        public void IsLeapYear_returnsFalse_notDivisibleBy4()
        {
            int yearToCheck = 2019;

            bool actualResult = LeapYearCalculator.IsLeapYear(yearToCheck);

            Assert.IsFalse(actualResult);
        }
Пример #4
0
        public void IsLeapYear_returnsFalse_divisibleBy100_notBy400()
        {
            int yearToCheck = 1900;

            bool actualResult = LeapYearCalculator.IsLeapYear(yearToCheck);

            Assert.IsFalse(actualResult);
        }
Пример #5
0
        public void MarkYearOneAsNonLeapYear()
        {
            // Arrange
            var expected = false;
            var year     = 1;

            // Act
            var actual = LeapYearCalculator.IsLeapYear(year);

            // Assert
            Assert.That(actual, Is.EqualTo(expected));
        }
Пример #6
0
        public void MarkYearEightAsLeapYear()
        {
            // Arrange
            var expected = true;
            var year     = 8;

            // Act
            var actual = LeapYearCalculator.IsLeapYear(year);

            // Assert
            Assert.That(actual, Is.EqualTo(expected));
        }