public void ShouldMapFakeDTOsTogether() { var productDTOs = new List<ProductDTO>(); for (var i = 0; i < 10; i++) { var productDTO = new ProductDTO {ASIN = i.ToString()}; productDTOs.Add(productDTO); } var reviewDTOs = new List<ReviewDTO>(); for (int i = 5; i < 15; i++) { var reviewDTO = new ReviewDTO {ASIN = i.ToString()}; reviewDTOs.Add(reviewDTO); } var amazonRequest = new AmazonRequest(); reviewMapper = new ReviewListMapper(amazonRequest, reviewDTOs, productDTOs); var reviews = reviewMapper.GetReviewList(); Assert.AreNotEqual(0, reviews.Count); Debug.WriteLine(reviews.Count); }
private static ReviewDTO MapReview(Review review) { var reviewToReturn = new ReviewDTO { ASIN = review.ASIN, Rating = review.Rating, Summary = review.Summary, Content = review.Content, Date = Convert.ToDateTime(review.Date), HelpfulVotes = Convert.ToInt32(review.HelpfulVotes), TotalVotes = Convert.ToInt32(review.TotalVotes), }; return reviewToReturn; }