Exemplo n.º 1
0
        public async Task GetReviewWithReviewId_NonExistentReview()
        {
            var service = new FakeReviewService(testReviews);
            var result  = await service.GetReviewAsync(13);

            Assert.IsNull(result);
            var reviewsResult = result as ReviewDto;

            Assert.IsNull(reviewsResult);
        }
Exemplo n.º 2
0
        public async Task GetReviewWithReviewId_ShouldTask()
        {
            var service = new FakeReviewService(testReviews);
            var result  = await service.GetReviewAsync(1);

            Assert.IsNotNull(result);
            var reviewsResult = result as ReviewDto;

            Assert.IsNotNull(reviewsResult);
            var targetReview = service._reviews.Find(r => r.reviewId == 1);

            Assert.AreEqual(targetReview.productId, reviewsResult.productId);
            Assert.AreEqual(targetReview.userId, reviewsResult.userId);
            Assert.AreEqual(targetReview.userName, reviewsResult.userName);
            Assert.AreEqual(targetReview.reviewRating, reviewsResult.reviewRating);
            Assert.AreEqual(targetReview.reviewContent, reviewsResult.reviewContent);
        }