Пример #1
0
        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)");
        }
Пример #2
0
        public void GivenAMessagePostedLessThanOneSecondAgo_FormatReturnsTheMessagePlusNow()
        {
            var message = new Message(userName, messageText, DateTime.Now, formatRules);

            var result = message.Format();

            result.Should().Be(messageText + " (now)");
        }
Пример #3
0
        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)");
        }
Пример #4
0
 private static string FormatMessageForWall(Message message)
 {
     return string.Format("{0} - {1}", message.UserName, message.Format());
 }