public ActionResult Reviews() { reviewRepository = new ReviewRepository(); var reviews = reviewRepository.GetAllReviews(); return(View(reviews)); }
public IActionResult ViewReviews(Truck truck) { var repo = new ReviewRepository(); var reviews = repo.GetAllReviews(); //var Reviews = repo.GetReviewsPerTruck(truck.ID); return(View(reviews)); }
public void TestGetAllReview() { var sql = new ReviewSqlContext(); var repo = new ReviewRepository(sql); var LstRvw = repo.GetAllReviews(); Assert.AreEqual(1, LstRvw[0].AuteurId); }
public void GetAllReviews() { try { // Arrange var reviewRepository = new ReviewRepository(RestaurantReviewsContext); // Act var reviews = reviewRepository.GetAllReviews().Result; // Assert Assert.IsTrue(reviews.Count() >= DataSeeder.Reviews.Count() , string.Format("Database has {0} Reviews and Seeder has {1}", reviews.Count(), DataSeeder.Reviews.Count())); } catch (Exception ex) { Assert.Fail(string.Format("An unexpected exception occurred in GetAllReviews {0}", ex.Message)); } }
// GET: Review public ActionResult Index(string sortOrder) { List <ReviewModel> reviews = _reviewRepository.GetAllReviews(); ViewBag.ReviewSortParam = string.IsNullOrEmpty(sortOrder) ? "review_desc" : ""; ViewBag.DateSortParam = sortOrder == "reviewdate" ? "date_desc" : "date"; reviews = SortReviews(reviews, sortOrder); foreach (var review in reviews) { var member = _memberRepository.GetMemberById(review.IdMember); var product = _productRepository.GetProdctById(review.IdProduct); review.MemberName = member.Name; review.ProductName = product.ProductName; } return(View("Index", reviews)); }
public void GetAllReviewsTest() { int x = Repo.GetAllReviews().Count; Assert.AreEqual(20, x); }
public List <Review> GetAllReviews() { return(_reviewRepo.GetAllReviews()); }