public void GetAverageReviewScoreByLodgingTest() { ContextObl context = ContextFactory.GetMemoryContext(Guid.NewGuid().ToString()); IReviewRepository reviewRepo = new ReviewRepository(context); ITouristSpotRepository touristSpotRepo = new TouristSpotRepository(context); ILodgingRepository lodgingRepo = new LodgingRepository(context); IRepository <Reserve> reserveRepo = new BaseRepository <Reserve>(context); touristSpotRepo.Add(touristSpot); lodgingRepo.Add(lodging); reserveRepo.Add(reserve); Review reviewToAdd = new Review() { Id = Guid.NewGuid(), Description = "Me gusto mucho la estadia", IdOfReserve = reserve.Id, LastNameOfWhoComments = reserve.LastName, NameOfWhoComments = reserve.Name, LodgingOfReview = lodging, Score = 4 }; reviewRepo.Add(reviewToAdd); double averageResult = reviewRepo.GetAverageReviewScoreByLodging(lodging.Id); Assert.AreEqual(4.0, averageResult); }