public void ForEachMonthsTest() { var count = 0; var period = GetPeriod(); if (period.HasPeriod) { TimeTool .ForEachMonths(period) .RunEach(month => { if (IsDebugEnabled) { log.Debug("Month [{0}] = {1}", count, month); } count++; }); Assert.AreEqual(period.ForEachMonths().Count(), count); } }