コード例 #1
0
        public void PostingReview_Will_Fail_When_productIdIsNotConsistent()
        {
            var productReviewDto = new ProductReviewDto
            {
                ProductId = 2,
                Score     = 2,
                Title     = "MyTitle",
                Recommend = true,
                Comments  = "Some Comments"
            };

            Assert.ThrowsAsync <InvalidRequestData>(
                () => _controller.Add(4, productReviewDto));
        }
コード例 #2
0
        public void AddRestaurantReviewTest()
        {
            controller = new ReviewController(facade.Object);
            var result        = controller.Add(null);
            var contentResult = result as OkNegotiatedContentResult <string>;

            Assert.AreEqual(contentResult.Content, "The review has been added for the restaurant. ");;
        }