示例#1
0
        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");
        }
示例#2
0
        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");
        }