public void Next_ReturnsPreviousFridayProperly()
    {
        var friday = new DateTimeOffset(2009, 7, 17, 1, 0, 0, 0, TimeSpan.Zero);
        var reallyPreviousFriday = new DateTimeOffset(2009, 7, 10, 1, 0, 0, 0, TimeSpan.Zero);
        var previousFriday = friday.Previous(DayOfWeek.Friday);

        Assert.AreEqual(reallyPreviousFriday, previousFriday);
    }
    public void BasicTests()
    {
        var now = DateTimeOffset.UtcNow;
        var expected = new DateTimeOffset(now.Year, now.Month, now.Day, 23, 59, 59, 999, TimeSpan.Zero);
        var actual = now.EndOfDay();
        Assert.AreEqual(expected, actual, " End of the day wrong");
        Assert.AreEqual(new DateTimeOffset(now.Year, now.Month, now.Day, 0, 0, 0, 0, TimeSpan.Zero), now.BeginningOfDay(), "Start of the day wrong");

        var firstBirthDay = new DateTimeOffset(1977, 12, 31, 17, 0, 0, 0, TimeSpan.Zero);
        Assert.AreEqual(firstBirthDay + new TimeSpan(1, 0, 5, 0, 0), firstBirthDay + 1.Days() + 5.Minutes());

        Assert.AreEqual(now + TimeSpan.FromDays(1), now.NextDay());
        Assert.AreEqual(now - TimeSpan.FromDays(1), now.PreviousDay());

        Assert.AreEqual(now + TimeSpan.FromDays(7), now.WeekAfter());
        Assert.AreEqual(now - TimeSpan.FromDays(7), now.WeekEarlier());

        Assert.AreEqual(new DateTimeOffset(2009, 1, 1, 0, 0, 0, 0, TimeSpan.Zero), new DateTimeOffset(2008, 12, 31, 0, 0, 0, TimeSpan.Zero).Add(1.Days()));
        Assert.AreEqual(new DateTimeOffset(2009, 1, 2, 0, 0, 0, 0, TimeSpan.Zero), new DateTimeOffset(2009, 1, 1, 0, 0, 0, 0, TimeSpan.Zero).Add(1.Days()));

        var sampleDate = new DateTimeOffset(2009, 1, 1, 13, 0, 0, 0, TimeSpan.Zero);
        Assert.AreEqual(new DateTimeOffset(2009, 1, 1, 12, 0, 0, 0, TimeSpan.Zero), sampleDate.Noon());
        Assert.AreEqual(new DateTimeOffset(2009, 1, 1, 0, 0, 0, 0, TimeSpan.Zero), sampleDate.Midnight());

        Assert.AreEqual(3.Days() + 3.Days(), 6.Days());
        Assert.AreEqual(102.Days() - 3.Days(), 99.Days());

        Assert.AreEqual(24.Hours(), 1.Days());

        sampleDate = new DateTimeOffset(2008, 1, 1, 0, 0, 0, 0, TimeSpan.Zero);
        Assert.AreEqual(3.Days().Since(sampleDate), sampleDate + 3.Days());

        var saturday = new DateTimeOffset(2008, 10, 25, 12, 0, 0, TimeSpan.Zero);
        Assert.AreEqual(new DateTimeOffset(2008, 11, 1, 12, 0, 0, TimeSpan.Zero), saturday.Next(DayOfWeek.Saturday));

        Assert.AreEqual(new DateTimeOffset(2008, 10, 18, 12, 0, 0, TimeSpan.Zero), saturday.Previous(DayOfWeek.Saturday));

        var nextWeek = DateTimeOffset.UtcNow + 1.Weeks();

        var tomorrow = DateTimeOffset.UtcNow + 1.Days();
        var yesterday = DateTimeOffset.UtcNow - 1.Days();
        var changedHourTo14H = DateTimeOffset.UtcNow.SetHour(14);
        var todayNoon = DateTimeOffset.UtcNow.Noon();
        var tomorrowNoon = DateTimeOffset.UtcNow.NextDay().Noon();
        var fiveDaysAgo = TimeSpanOffsetExtensions.Ago(5.Days());
        var twoDaysFromNow = TimeSpanOffsetExtensions.FromNow(2.Days());
        var nextYearSameDateAsTodayNoon = TimeSpanOffsetExtensions.FromNow(1.Years()).Noon();

        var twoWeeksFromNow = TimeSpanOffsetExtensions.FromNow(2.Weeks());

    }