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 }); }
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); }
public void EmptyCommentThrowsArgOORException(string content) { Library.Models.Comment comment = new Library.Models.Comment(); Assert.Throws <ArgumentOutOfRangeException>(() => comment.Content = content); }
public void NullCommentThrowsArgNullException(string content) { Library.Models.Comment comment = new Library.Models.Comment(); Assert.Throws <ArgumentNullException>(() => comment.Content = content); }