Пример #1
0
 public void GetNumberOfPeriodsInYear_WeeklyPeriodAnd365DayYearPolicy_ReturnsCorrectNumber()
 {
     var date = new DateTime(2013, 6, 11);
     var policy = new CustomPeriodPolicy(7);
     var yearPolicy = new ThreeHundredSixtyFiveDayYearPolicy();
     Assert.That(Math.Round(policy.GetNumberOfPeriodsInYear(date, yearPolicy), 2), Is.EqualTo(52.14));
 }
Пример #2
0
 public void GetNumberOfDays_WeeklyPeriod_ReturnsSeven()
 {
     var date = new DateTime(2013, 6, 11);
     var policy = new CustomPeriodPolicy(7);
     Assert.That(policy.GetNumberOfDays(date), Is.EqualTo(7));
 }
Пример #3
0
 public void GetPreviousDate_WeeklyPeriod_ReturnsPreviousWeek()
 {
     var date = new DateTime(2013, 6, 11);
     var policy = new CustomPeriodPolicy(7);
     Assert.That(policy.GetPreviousDate(date), Is.EqualTo(new DateTime(2013, 6, 4)));
 }