public void GetCommentsQueryByPostId_havePostsWithId2AndId3_postWithId2Returned() { // Arrange const int commentId = 2; var commentBo = new CommentBo(_commentRepo, _commentLikesRepo); _commentRepo.Query() .Returns(new List<Comment> { new Comment { Id = commentId, }, new Comment() { Id = commentId+1, } }.AsQueryable()); // Act var query = commentBo.GetCommentsQueryByPostId(2); // Assert foreach (var q in query) { Assert.AreEqual(commentId, q.Id); } }