Exemple #1
0
        public void TestIdentityMapOfProductFinder()
        {
            int productId        = 9;
            int anotherProductId = 54;

            ProductFinder  productFinder   = new ProductFinder();
            ProductGateway productGateway1 = productFinder.FindProductGatewayById(productId);
            ProductGateway productGateway2 = productFinder.FindProductGatewayById(productId);

            Assert.AreEqual(productGateway1, productGateway2);

            ProductGateway productGateway3 = productFinder.FindProductGatewayById(anotherProductId);

            Assert.AreNotEqual(productGateway1, productGateway3);
            Assert.AreNotEqual(productGateway2, productGateway3);
        }
Exemple #2
0
        public void TestProductFinder()
        {
            int productId = 9;

            ProductFinder  productFinder  = new ProductFinder();
            ProductGateway productGateway = productFinder.FindProductGatewayById(productId);

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