Пример #1
0
 public static Entities.Comments MapComments(Library.Models.Comment comments)
 {
     return(new Entities.Comments
     {
         CommentId = comments.CommentId,
         PostId = comments.Post.PostID,
         UserId = comments.User.UserID,
         Content = comments.Content,
         TimeSent = comments.TimeSent
     });
 }
Пример #2
0
        public void LongCommentThrowsArgOORException()
        {
            Library.Models.Comment comment = new Library.Models.Comment();

            // 282 Character string
            string longString = "Lorem ipsum dolor sit amet consectetur adipiscing elit," +
                                " mollis lectus est tempus auctor malesuada, nam sociis dignissim habitant" +
                                " nec varius litora, vestibulum sem vel odio etiam. Arcu dignissim quis sem" +
                                " tempor ac ornare praesent eget nascetur, et malessuada class habitasse egestas.";

            Assert.Throws <ArgumentOutOfRangeException>(() => comment.Content = longString);
        }
Пример #3
0
 public void EmptyCommentThrowsArgOORException(string content)
 {
     Library.Models.Comment comment = new Library.Models.Comment();
     Assert.Throws <ArgumentOutOfRangeException>(() => comment.Content = content);
 }
Пример #4
0
 public void NullCommentThrowsArgNullException(string content)
 {
     Library.Models.Comment comment = new Library.Models.Comment();
     Assert.Throws <ArgumentNullException>(() => comment.Content = content);
 }