public void Update_CalledUpdateMethod()
        {
            //Arrange
            _productRepository.Setup(x => x.GetOne(It.IsAny <Func <Product, bool> >()))
            .Returns(new Product()
            {
                ID = 1, Name = "First"
            });

            _productRepository.Setup(x => x.Update(It.IsAny <Product>()));

            //Act
            _service.ChangeProduct(new MProduct());

            //Assert
            _productRepository.Verify(x => x.Update(It.IsAny <Product>()), Times.Once);
        }
Exemplo n.º 2
0
        public void Put(int id, [FromBody] MProduct value)
        {
            ProductActions p1 = new ProductActions();

            p1.ChangeProduct(value);
        }