Exemplo n.º 1
0
        //[TestMethod]
        public void ItShouldCallCreateProduct()
        {
            //arrange
            var mockDataAccess = new Mock <ITypeProduct>();

            mockDataAccess.Setup(a => a.CreateProduct(It.IsAny <Product>())).Returns(true);
            var productBusiness = new ProductBusinessFactory(mockDataAccess.Object);

            //act
            productBusiness.CreateProduct(new Product());

            //assert
            mockDataAccess.Verify(a => a.CreateProduct(It.IsAny <Product>()), Times.Once());
        }
 public ProductController()
 {
     productBusiness = ProductBusinessFactory.Create();
 }