Exemple #1
0
        public void UnitTest1(long ProductId)
        {
            _productLayer
            .Setup(x => x.ReadSingleProduct(ProductId))
            .Returns(ProductId == 100 ? new Item() : null);

            var ActualResult = _productBiz.ReadSingleProduct(ProductId);

            Assert.NotNull(ActualResult);
            Assert.True(ActualResult.StatusCode == 200);
            Assert.NotNull(ActualResult.Product);
            Assert.Null(ActualResult.ErrorList);
        }
        public ActionResult <SingleProductResponse> Get(long productId)
        {
            SingleProductResponse response = _productBiz.ReadSingleProduct(productId);

            return(Ok(response));
        }