예제 #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
파일: Codurer.cs 프로젝트: vgaltes/Codurer
 private static string FormatMessageForWall(Message message)
 {
     return string.Format("{0} - {1}", message.UserName, message.Format());
 }