public void TimeSince_GreaterThanOneWeek_ReturnsWeeks() { Expect(FriendlyGoals.TimeSince(TimeSpan.FromDays(7)), Is.EqualTo("1 weeks ago")); Expect(FriendlyGoals.TimeSince(TimeSpan.FromDays(14)), Is.EqualTo("2 weeks ago")); Expect(FriendlyGoals.TimeSince(TimeSpan.FromDays(21)), Is.EqualTo("3 weeks ago")); Expect(FriendlyGoals.TimeSince(TimeSpan.FromDays(28)), Is.EqualTo("4 weeks ago")); Expect(FriendlyGoals.TimeSince(TimeSpan.FromDays(35)), Is.EqualTo("5 weeks ago")); }
public void TimeSince_WithinLastMinute_ReturnsJustNow() { Expect(FriendlyGoals.TimeSince(TimeSpan.Parse("00:00:00")), Is.EqualTo("just now")); Expect(FriendlyGoals.TimeSince(TimeSpan.Parse("00:00:59")), Is.EqualTo("just now")); }
public void TimeSince_BetweenTwoDaysAndOneWeek_ReturnsDays() { Expect(FriendlyGoals.TimeSince(TimeSpan.FromDays(2)), Is.EqualTo("2 days ago")); Expect(FriendlyGoals.TimeSince(TimeSpan.FromDays(7).Subtract(TimeSpan.FromSeconds(1))), Is.EqualTo("6 days ago")); }
public void TimeSince_BetweenOneDayAndTwoDays_ReturnsYesterday() { Expect(FriendlyGoals.TimeSince(TimeSpan.FromDays(1)), Is.EqualTo("yesterday")); Expect(FriendlyGoals.TimeSince(TimeSpan.FromDays(2).Subtract(TimeSpan.FromSeconds(1))), Is.EqualTo("yesterday")); }
public void TimeSince_BetweenTwoHoursAndOneDay_ReturnsHours() { Expect(FriendlyGoals.TimeSince(TimeSpan.Parse("02:00:00")), Is.EqualTo("2 hours ago")); Expect(FriendlyGoals.TimeSince(TimeSpan.Parse("23:59:59")), Is.EqualTo("23 hours ago")); }
public void TimeSince_BetweenOneHourAndTwoHours_ReturnsOneHourAgo() { Expect(FriendlyGoals.TimeSince(TimeSpan.Parse("01:00:00")), Is.EqualTo("1 hour ago")); Expect(FriendlyGoals.TimeSince(TimeSpan.Parse("01:59:59")), Is.EqualTo("1 hour ago")); }
public void TimeSince_BetweenTwoMinutesAndOneHour_ReturnsMinutesRoundedDown() { Expect(FriendlyGoals.TimeSince(TimeSpan.Parse("00:02:00")), Is.EqualTo("2 minutes ago")); Expect(FriendlyGoals.TimeSince(TimeSpan.Parse("00:59:59")), Is.EqualTo("59 minutes ago")); }
public void TimeSince_BetweenOneAndTwoMinutes_ReturnsOneMinuteAgo() { Expect(FriendlyGoals.TimeSince(TimeSpan.Parse("00:01:00")), Is.EqualTo("1 minute ago")); Expect(FriendlyGoals.TimeSince(TimeSpan.Parse("00:01:59")), Is.EqualTo("1 minute ago")); }