Ejemplo n.º 1
0
            public void TestIdentityMapOfQueryProductWithCategoryId()
            {
                int categoryId = 6;

                ProductMapper   productMapper   = new ProductMapper();
                IList <Product> products        = productMapper.FindProductsWithCategoryId(categoryId);
                IList <Product> anotherProducts = productMapper.FindProductsWithCategoryId(categoryId);

                for (int i = 0; i < products.Count; i++)
                {
                    Assert.AreEqual(products[i], anotherProducts[i]);
                }
            }
Ejemplo n.º 2
0
            public void TestQueryProductWithCategoryId()
            {
                int categoryId = 6;

                ProductMapper   productMapper = new ProductMapper();
                IList <Product> products      = productMapper.FindProductsWithCategoryId(categoryId);

                Assert.AreEqual(6, products.Count);

                Assert.AreEqual(9, products[0].ProductID);
                Assert.AreEqual("Mishi Kobe Niku", products[0].ProductName);
                Assert.AreEqual(4, products[0].SupplierID);
                Assert.AreEqual(6, products[0].CategoryID);
                Assert.AreEqual("18 - 500 g pkgs.", products[0].QuantityPerUnit);
                Assert.AreEqual(97.0000m, products[0].UnitPrice);
                Assert.AreEqual((short)29, products[0].UnitsInStock);
                Assert.AreEqual((short)0, products[0].UnitsOnOrder);
                Assert.AreEqual((short)0, products[0].ReorderLevel);
                Assert.AreEqual(true, products[0].Discontinued);


                Assert.AreEqual(17, products[1].ProductID);
                Assert.AreEqual(29, products[2].ProductID);
                Assert.AreEqual(53, products[3].ProductID);
                Assert.AreEqual(54, products[4].ProductID);
                Assert.AreEqual(55, products[5].ProductID);
            }