Exemplo n.º 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));
        }
Exemplo n.º 2
0
 public IHttpActionResult UpdateProduct(Product product)
 {
     _service.UpdateProduct(product);
     return(Ok());
 }