public void GetAllReviewsByUserIdTest() { int userId = 3; List <Review> reviews = Repo.GetAllReviewsByUserID(userId); Assert.AreEqual(1, reviews.Count); }
public IActionResult Index() { int id = Convert.ToInt32(this.User.FindFirstValue(ClaimTypes.NameIdentifier)); List <Book> Books = BookRepo.GetUserBacklog(id); List <Review> Reviews = ReviewRepo.GetAllReviewsByUserID(id); OverviewViewModel VM = new OverviewViewModel(); foreach (Book B in Books) { VM.UserBacklog.Books.Add(BookConverter.BookToBookViewModel(B)); } foreach (Review R in Reviews) { VM.UserReviews.Reviews.Add(ReviewConverter.ReviewToReviewViewModel(R)); } return(View(VM)); }