public void SeeIfProductByIDReturnsNullIfProductDoesNotExist() { List <Product> products = new List <Product>() { new Product(1, "Mælk", "l", "Food"), new Product(2, "Kage", "kg", "Snack") }; ListOfProducts productlist = new ListOfProducts(products, null); Assert.AreEqual(productlist.FindProductByID(1).PrimaryProductName, "Mælk"); }
public void SeeIfProductByIDWorksByProductType() { List <Product> products = new List <Product>() { new Product(1, "Mælk", "l", "Food"), new Product(2, "Kage", "kg", "Snack") }; ListOfProducts productlist = new ListOfProducts(products, null); Product foundProduct = productlist.FindProductByID(1); //See if the product found is the same as the expected Assert.IsTrue(foundProduct.TypeOfProduct == "Food"); }