Esempio n. 1
0
        public void ProductAndVendorNameTest()
        {
            List <Product> query = KlasaNarzędziowaEtap3.GetProductsByName("Adjustable Race");

            if (query.ProductWithItsVendor().Replace("\n", "") != "Adjustable Race-Litware, Inc.")
            {
                Assert.Fail();
            }
        }
        public void GetProductsByNameTest()
        {
           
            List<Product> products = KlasaNarzędziowaEtap3.GetProductsByName("Blade");

            List<Product> stala = new List<Product>();
            Product C = (from p in db.Products where p.ProductID == 316 select p).First();
            stala.Add(C);
        

            for (int i = 0; i < products.Count(); i++)
            {
                if (products[i].ProductID != stala[i].ProductID) Assert.Fail();
                if (products[i].Name != stala[i].Name) Assert.Fail();
            }
            if (products.Count() != stala.Count()) Assert.Fail();
        }