public void GivenAMessagePostedOneSecondAgo_FormatReturnsTheMessagePlus1SecondAgo() { var message = new Message(userName, messageText, DateTime.Now.AddSeconds(-1), formatRules); var result = message.Format(); result.Should().Be(messageText + " (1 second ago)"); }
public void GivenAMessagePostedLessThanOneSecondAgo_FormatReturnsTheMessagePlusNow() { var message = new Message(userName, messageText, DateTime.Now, formatRules); var result = message.Format(); result.Should().Be(messageText + " (now)"); }
public void GivenAMessagePostedMoreThanOneSecondAgoAndLessThanOneMinuteAgo_FormatReturnsTheMessagePlusSeconds() { var message = new Message(userName, messageText, DateTime.Now.AddSeconds(-2), formatRules); var result = message.Format(); result.Should().Be(messageText + " (2 seconds ago)"); }
private static string FormatMessageForWall(Message message) { return string.Format("{0} - {1}", message.UserName, message.Format()); }