private static PayPeriodDTO MapForPPStartWeek(WeekDTO currentWeek) { var next = currentWeek.Next(); return(new PayPeriodDTO() { PayPeriodStart = currentWeek.WeekStart, PayPeriodEnd = next.WeekEnd, StartWeekId = currentWeek.WeekId.Value, EndWeekId = next.WeekId.Value, }); }
public void InternallyConsistandWeekCycles() { var start = new WeekDTO(new DateTime(WeekDTO.WeekEpoch.Year, WeekDTO.WeekEpoch.Month, WeekDTO.WeekEpoch.Day)); Assert.AreEqual(0, start.WeekId.Value); var next = start.Next(); Assert.AreEqual(1, next.WeekId.Value); var next2 = next.Next(); Assert.AreEqual(2, next2.WeekId.Value); var stillNext2 = WeekDTO.CreateWithWeekContaining(next2.WeekEnd.AddDays(-2)); Assert.AreEqual(next2, stillNext2); }