2425262728293031
public void ratePlace(Place place, Rating rating) { place.addRating(rating); } public TotalRating getTotalRating(Place place) { TotalRating totalRating = new TotalRating(place.getRatings()); return totalRating; }
868788899091929394
rating.setComment(ratingComment); rating.setRate(Rate.R10); service.ratePlace(place, rating); TotalRating totalRating = service.getTotalRating(place); assertEquals(Rate.R10, totalRating.getRate()); }
122123124125126127128129130
service.ratePlace(place, rating); int avgRate = ((r1.getValue() + r2.getValue() + r3.getValue()) / 3); Rate totalRate = Rate.valueOf(avgRate); TotalRating totalRating = service.getTotalRating(place); assertEquals(totalRate, totalRating.getRate()); }