public PostsControllerTests() { var users = FakeRepositories.FakeUsers.ToList(); var blogs = FakeRepositories.GetFakeBlogs(users).ToList(); var posts = FakeRepositories.GetFakePosts(blogs).ToList(); var postsLikes = FakeRepositories.GetFakePostLikes(posts, users); _blogRepository.Setup(c => c.Blogs).Returns(blogs.AsQueryable); _postRepository.Setup(c => c.Posts).Returns(posts.AsQueryable); _postLikeRepository.Setup(l => l.PostLikes).Returns(postsLikes.AsQueryable); }
public CommentLikeControllerTests() { var users = FakeRepositories.FakeUsers.ToList(); var blogs = FakeRepositories.GetFakeBlogs(users).ToList(); var posts = FakeRepositories.GetFakePosts(blogs).ToList(); var comments = FakeRepositories.GetFakeComments(posts, users).ToList(); var commentsLike = FakeRepositories.GetFakeCommentLikes(comments, users); _userRepository.Setup(r => r.Users).Returns(users.AsQueryable); _commentRepository.Setup(r => r.Comments).Returns(comments.AsQueryable); _commentLikeRepository.Setup(r => r.CommentLikes).Returns(commentsLike.AsQueryable); }
public CommentControllerTests() { var users = FakeRepositories.FakeUsers.ToList(); var blogs = FakeRepositories.GetFakeBlogs(users).ToList(); var posts = FakeRepositories.GetFakePosts(blogs).ToList(); var comments = FakeRepositories.GetFakeComments(posts, users).ToList(); var commentLikes = FakeRepositories.GetFakeCommentLikes(comments, users); _userRepository.Setup(u => u.Users).Returns(users.AsQueryable()); _postRepository.Setup(p => p.Posts).Returns(posts.AsQueryable()); _commentRepository.Setup(c => c.Comments).Returns(comments.AsQueryable()); _commentLikeRepository.Setup(c => c.CommentLikes).Returns(commentLikes.AsQueryable()); }