public void PrintMessage(IEnumerable <Message> messages) { DateTime now = _dateTimeHelper.CurrentDateTime; foreach (var message in messages.OrderByDescending(m => m.CreatedDate)) { string humanizedTimeSpan = GetHumanizedTimeSpan(now.Subtract(message.CreatedDate)); var formattedMessage = string.Format("{0} ({1} ago)", message.Text, humanizedTimeSpan); _printerHelper.WriteLine(formattedMessage); } }
public void Execute() { _printerHelper.WriteLine("Unrecognized command"); }