Ejemplo n.º 1
0
        public void getTotalStandardCostByCategoryTest()
        {
            AdventureWorksLinqToSqlDataContext db = new AdventureWorksLinqToSqlDataContext();
            var query = (from category in db.ProductCategories
                         select category).Take(1);

            Assert.AreEqual((decimal)92092.8230, AdventureWorksLinq.getTotalStandardCostByCategory(query.First()));
        }
Ejemplo n.º 2
0
        public void getProductNamesByVendorNameTest()
        {
            List <string> products = AdventureWorksLambda.getProductNamesByVendorName("International");

            Assert.AreEqual("Lower Head Race", products[0]);

            //Compare with LINQ without Lambda
            List <string> expected = AdventureWorksLinq.getProductNamesByVendorName("International");

            CollectionAssert.AreEqual(expected, products);
        }
Ejemplo n.º 3
0
        public void getNProductsSortedByCategoryTest()
        {
            List <Product> products = AdventureWorksLinq.getNProductsSortedByCategory(10);

            Assert.IsTrue(products.Count == 10);
        }
Ejemplo n.º 4
0
        public void getNRecentlyReviewedProductsTest()
        {
            List <Product> products = AdventureWorksLinq.getNRecentlyReviewedProducts(1);

            Assert.IsTrue(products.Count == 1);
        }
Ejemplo n.º 5
0
        public void getProductNamesByVendorNameTest()
        {
            List <string> products = AdventureWorksLinq.getProductNamesByVendorName("International");

            Assert.AreEqual("Lower Head Race", products[0]);
        }