Example #1
0
        public void TestUpdateProductVariableNull(int productId, string ingrediants, string descriptions,
                                                  int quantity)
        {
            //Arrange
            Mock <IProductRepository> mockProductRepository =
                new Mock <IProductRepository>();
            IProductApplicationService productsApplicationService =
                new ProductApplicationService(mockProductRepository.Object);

            ProductDto products = new ProductDto()
            {
                ProductId    = productId,
                Ingrediants  = ingrediants,
                Descriptions = descriptions,
                Quantity     = quantity
            };

            //Act & Assert
            Assert.Throws <InvalidOperationException>(() => productsApplicationService
                                                      .UpdateProduct(products));
        }
 public IHttpActionResult UpdateProduct(Product product)
 {
     _service.UpdateProduct(product);
     return(Ok());
 }