public MockCommentRepository Initialize() { MockCommentRepository repo = new MockCommentRepository(); Comment comment1 = new Comment { Id = 1, UserId = "12", ContentId = 1 }; repo.Save(comment1); Comment comment2 = new Comment { Id = 2, UserId = "12", ContentId = 1 }; repo.Save(comment2); Comment comment3 = new Comment { Id = 3, UserId = "14", ContentId = 2 }; repo.Save(comment3); Comment comment4 = new Comment { Id = 4, UserId = "11", ContentId = 3 }; repo.Save(comment4); Comment comment5 = new Comment { Id = 5, UserId = "13", ContentId = 4 }; repo.Save(comment5); return(repo); }
public void CommentsOnPostTest() { MockCommentRepository repo = Initialize(); var result = repo.GetCommentById(1, repo); var expectedResult = "12"; Assert.AreEqual(result.UserId, expectedResult); }
public void CommentsOnPostCountTest() { MockCommentRepository repo = Initialize(); var result = repo.GetAllCommentsForPost(1, repo); var expectedResult = 2; Assert.AreEqual(result.Count, expectedResult); }
public void CommentTest() { MockCommentRepository repo = new MockCommentRepository(); Comment comment1 = new Comment { Id = 1 }; repo.Save(comment1); Assert.AreEqual(repo.Comments.Count, 1); /* * var results = ContentService.GetAlbumById(1, repo); * var expectedID = 1; * Assert.AreEqual(results.Id, expectedID);*/ }
public void CommentCountTest() { MockCommentRepository repo = Initialize(); Assert.AreEqual(repo.Comments.Count, 5); }
public void Initialize() { _mockCommentRepo = new MockCommentRepository(); _commentLogic = new CommentLogic(_mockCommentRepo); }