public void PrintedWallMessageShouldHaveCorrectFormat()
 {
     Message message = new Message ("Message",
         "mcarmen",
         DateTime.Now.AddSeconds (-30));
     message.PrintInWall ();
     string expected = string.Format("mcarmen - Message (30 seconds ago){0}", Environment.NewLine);
     Assert.AreEqual (expected, _standardOut.ToString ());
 }
 public void PrintedMessageShouldPrintMinutesPassed()
 {
     Message message = new Message ("Message",
         "mcarmen",
         DateTime.Now.AddMinutes (-5));
     message.Print ();
     string expected = string.Format("Message (5 minutes ago){0}", Environment.NewLine);
     Assert.AreEqual (expected, _standardOut.ToString ());
 }
Exemple #3
0
 public void Post(string message, DateTime timestamp)
 {
     Message postedMessage = new Message (message, Name, timestamp);
     Messages.Add (postedMessage);
 }
Exemple #4
0
 public void Post(string message)
 {
     Message postedMessage = new Message (message, Name);
     Messages.Add (postedMessage);
 }