public void Formatting_With_Hours_Difference() { var date = DateTime.Now.AddHours(-5); var formatter = new PrettyFormatter(); var result = formatter.Format(date); Assert.AreEqual("5 hours ago", result); }
public void Formatting_With_Minutes_Difference() { var date = DateTime.Now.AddMinutes(-10); var formatter = new PrettyFormatter(); var result = formatter.Format(date); Assert.AreEqual("10 minutes ago", result); }
public void Formatting_With_One_Week_Difference() { var date = DateTime.Now.AddDays(-7); var formatter = new PrettyFormatter(); var result = formatter.Format(date); Assert.AreEqual("a week ago", result); }
public void Formatting_With_Days_Difference() { var date = DateTime.Now.AddDays(-3); var formatter = new PrettyFormatter(); var result = formatter.Format(date); Assert.AreEqual("3 days ago", result); }
public void Formatting_With_A_Day_Difference() { var date = DateTime.Now.AddDays(-1); var formatter = new PrettyFormatter(); var result = formatter.Format(date); Assert.AreEqual("yesterday", result); }
public void Formattting_With_Seconds_Difference() { var date = DateTime.Now.AddSeconds(-30); var formatter = new PrettyFormatter(); var result = formatter.Format(date); Assert.AreEqual("just now", result); }