Пример #1
0
        public void CountTimeUnits_ReturnsProperValue_IfComparedDateIsFromPreviousYear()
        {
            //Arrange
            WeeksProcessor processor    = new WeeksProcessor();
            DateTime       baseDate     = new DateTime(2016, 4, 21);
            DateTime       comparedDate = new DateTime(2015, 12, 5);

            //Act
            int unitsBetween = processor.CountTimeUnits(baseDate, comparedDate, 1);

            //Assert
            int expected = -20;

            Assert.AreEqual(expected, unitsBetween);
        }
Пример #2
0
        public void CountTimeUnits_ReturnsZero_IfBothDatesInTheSameWeekButBaseDateIsLater()
        {
            //Arrange
            WeeksProcessor processor    = new WeeksProcessor();
            DateTime       baseDate     = new DateTime(2016, 4, 21);
            DateTime       comparedDate = new DateTime(2016, 4, 19);

            //Act
            int unitsBetween = processor.CountTimeUnits(baseDate, comparedDate, 1);

            //Assert
            int expected = 0;

            Assert.AreEqual(expected, unitsBetween);
        }
Пример #3
0
        public void CountTimeUnits_ReturnsProperValue_IfBaseDateIsEarlier()
        {
            //Arrange
            WeeksProcessor processor    = new WeeksProcessor();
            DateTime       baseDate     = new DateTime(2016, 4, 1);
            DateTime       comparedDate = new DateTime(2016, 4, 21);

            //Act
            int unitsBetween = processor.CountTimeUnits(baseDate, comparedDate, 1);

            //Assert
            int expected = 3;

            Assert.AreEqual(expected, unitsBetween);
        }
Пример #4
0
        public void CountTimeUnits_ReturnsZero_IfDateInTheSameWeekIsGiven()
        {
            //Arrange
            WeeksProcessor processor    = new WeeksProcessor();
            DateTime       baseDate     = new DateTime(2016, 8, 9);
            DateTime       comparedDate = new DateTime(2016, 8, 11);

            //Act
            int unitsBetween = processor.CountTimeUnits(baseDate, comparedDate, 1);

            //Assert
            int expected = 0;

            Assert.AreEqual(expected, unitsBetween);
        }