Ejemplo n.º 1
0
        public void GetInvolvedYearsShouldReturnCorrectResultWhenTwoDatesAreUsed()
        {
            var start = new DateTime(2016, 01, 01, 0, 0, 0);
            var end   = new DateTime(2018, 01, 01, 0, 0, 0);

            var result = new DateCalculationService().GetInvolvedYears(start, end);

            result.Should().HaveCount(3);
            result.Should().Contain(new List <int>()
            {
                2016, 2017, 2018
            });
        }
Ejemplo n.º 2
0
        public void GetInvolvedYearsShouldReturnOneYearWhenStartAndEndAreEqual()
        {
            var start = new DateTime(2016, 01, 01, 0, 0, 0);
            var end   = new DateTime(2016, 01, 01, 0, 0, 0);

            var result = new DateCalculationService().GetInvolvedYears(start, end);

            result.Should().HaveCount(1);
        }
Ejemplo n.º 3
0
        public void GetCalendarWeekShouldReturnTheCorrectCalenderWeekForTheFirstDay()
        {
            var date = new DateTime(2016, 08, 28, 0, 0, 0);

            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("de");
            var cw = new DateCalculationService().GetCalendarWeek(date);

            cw.Should().Be(34);
        }