public void Delete_ProductNotInDataStore_ShouldReturnFalse() { //arrange SqlProductRepository productRepository = new SqlProductRepository(connectionString); //act bool deleted = productRepository.Delete("z1"); //assert Assert.False(deleted); }
public void Delete_Product_ShouldRemoveProduct() { //arrange SqlProductRepository productRepository = new SqlProductRepository(connectionString); //act bool deleted = productRepository.Delete("p1"); //assert Assert.True(deleted); Assert.DoesNotContain(productRepository.SelectAll(), p => p.Id == "p1"); Assert.Equal(8, productRepository.SelectAll().Count); }
public bool DeleteProduct(int productId) { return(_productRepository.Delete(productId)); }