public void GetPreviousMonthTest() { var month = new MonthRange(); month.GetPreviousMonth().Should().Be(month.AddMonths(-1)); month.GetPreviousMonth().Start.Should().Be(ClockProxy.Clock.Now.AddMonths(-1).StartTimeOfMonth()); }
public void MonthMomentTest() { var month = new MonthRange(new DateTime(2008, 1, 15), TimeCalendar.NewEmptyOffset()); month.IsReadOnly.Should().Be.True(); month.Year.Should().Be(2008); month.Month.Should().Be(TimeSpec.CalendarYearStartMonth); month.Start.Should().Be(new DateTime(2008, 1, 1)); month.End.Should().Be(new DateTime(2008, 2, 1)); var previous = month.GetPreviousMonth(); previous.Year.Should().Be(2007); previous.Month.Should().Be(12); previous.Start.Should().Be(new DateTime(2007, 12, 1)); previous.End.Should().Be(new DateTime(2008, 1, 1)); var next = month.GetNextMonth(); next.Year.Should().Be(2008); next.Month.Should().Be(2); next.Start.Should().Be(new DateTime(2008, 2, 1)); next.End.Should().Be(new DateTime(2008, 3, 1)); }
public void MonthMomentTest() { var month = new MonthRange(new DateTime(2008, 1, 15), TimeCalendar.NewEmptyOffset()); month.IsReadOnly.Should().Be.True(); month.Year.Should().Be(2008); month.Month.Should().Be(TimeSpec.CalendarYearStartMonth); month.Start.Should().Be(new DateTime(2008, 1, 1)); month.End.Should().Be(new DateTime(2008, 2, 1)); var previous = month.GetPreviousMonth(); previous.Year.Should().Be(2007); previous.Month.Should().Be(12); previous.Start.Should().Be(new DateTime(2007, 12, 1)); previous.End.Should().Be(new DateTime(2008, 1, 1)); var next = month.GetNextMonth(); next.Year.Should().Be(2008); next.Month.Should().Be(2); next.Start.Should().Be(new DateTime(2008, 2, 1)); next.End.Should().Be(new DateTime(2008, 3, 1)); }
public void GetPreviousMonthTest() { var month = new MonthRange(); month.GetPreviousMonth().Should().Be(month.AddMonths(-1)); month.GetPreviousMonth().Start.Should().Be(ClockProxy.Clock.Now.AddMonths(-1).StartTimeOfMonth()); }