public ProductController(IRepositoryProducts repositoryProducts, IRepositoryUser user, IReadFromBrowser read, ICheckUserExist checkUser, ILogger logger) { _repositoryProducts = repositoryProducts; _repositoryUser = user; _read = read; _check = checkUser; _logger = logger; }
public ShoppingCartController(ICartManager cartManager, IRepositoryProducts repositoryProducts, IReadFromBrowser read, IWriteToBrowser write, ICheckUserExist checkUser , ILogger logger) { _cartManager = cartManager; _repositoryProducts = repositoryProducts; _read = read; _write = write; _check = checkUser; _logger = logger; }
public void SalvarProdutos() { ProductEntity product = new ProductEntity() { Name = "Arroz", Discount = 20, Price = 19, Stock = 30 }; Moq.Mock <IRepositoryProducts> mock = new Moq.Mock <IRepositoryProducts>(); mock.Setup(p => p.Insert(product)).ReturnsAsync(product); IRepositoryProducts repository = mock.Object; var result = repository.Insert(product); Assert.NotNull(result.Result); }
public void DeletarProduto() { ProductEntity product = new ProductEntity() { Name = "Arroz", Discount = 20, Price = 19, Stock = 30 }; Moq.Mock <IRepositoryProducts> mock = new Moq.Mock <IRepositoryProducts>(); mock.Setup(p => p.Insert(product)).ReturnsAsync(product); mock.Setup(p => p.Delete(product.Id)).ReturnsAsync(true); IRepositoryProducts repository = mock.Object; repository.Insert(product); var result = repository.Delete(product.Id); Assert.True(result.Result); }
public EmptyCart(ICartManager cartManager, IRepositoryProducts repositoryProducts) { _cartManager = cartManager; _repositoryProducts = repositoryProducts; }
public HomeController(IRepositoryProducts repositoryProducts, IReadFromBrowser read, IWriteToBrowser write) { _repositoryProducts = repositoryProducts; _read = read; _write = write; }
public ProductController(IRepositoryProducts repo) { this.repo = repo; }
public ProductServise(IRepositoryProducts productRepository) { _productRepository = productRepository; }
public ServiceProducts(IRepositoryProducts repository) { _repository = repository; }