GetLatestProfileComment() 공개 메소드

public GetLatestProfileComment ( ) : Comment
리턴 Comment
예제 #1
0
 public void ShouldBeAbleToGetTheLatestComment()
 {
     var user1 = new User(new LoginId("*****@*****.**"), new Name("firstName1", "lastName1"));
     user1.AddCommentToProfile(new Comment(user1,user1,"This is the first comment",new GetInDate(new DateTime(2010,01,01))));
     user1.AddCommentToProfile(new Comment(user1,user1,"This is the second comment",new GetInDate(new DateTime(2010,02,03))));
     user1.AddCommentToProfile(new Comment(user1,user1,"This is the third comment",new GetInDate(new DateTime(2010,01,02))));
     Assert.AreEqual("This is the second comment",user1.GetLatestProfileComment().Content);
 }
예제 #2
0
 public void UserShouldBeAbleToCommentOnAProfile()
 {
     var user1 = new User(new LoginId("*****@*****.**"), new Name("firstName1", "lastName1"));
     var user2 = new User(new LoginId("*****@*****.**"), new Name("firstName2", "lastName2")) { Profile = new Profile("This is the profile on which user1 will comment") };
     var comment = new Comment(user1, user2, "This is what I am going to comment");
     Assert.AreEqual(comment.Commentor, user1);
     Assert.AreEqual(comment.CommentedOn, user2);
     Assert.AreEqual(comment, user2.GetLatestProfileComment());
 }