public void WhenANewProductIsCreated_ItIsAddedToTheDatabase()
        {
            int originalNum = _crud.RetrieveAll <Product>().Count;

            _crud.Create("newTest", 10, "testURL");
            Assert.That(originalNum + 1, Is.EqualTo(_crud.RetrieveAll <Product>().Count));

            Product newProduct = _crud.GetProductByName("newTest");

            _crud.Delete(newProduct);
        }
        private void PopulateProductList()
        {
            List <Product> allProducts = CrudProduct.RetrieveAll <Product>();

            if (textBox_product_search.Text == string.Empty)
            {
                listBox_product.ItemsSource = allProducts;
            }
            else
            {
                List <Product> searchResults = new List <Product>();
                foreach (Product prod in allProducts)
                {
                    string nameUpper = prod.Name.ToUpper();
                    if (nameUpper.Contains(textBox_product_search.Text.ToUpper()))
                    {
                        searchResults.Add(prod);
                    }
                }
                listBox_product.ItemsSource = searchResults;
            }
        }