Example #1
0
        public void ProductUpdateErrorTest()
        {
            List <string> errors             = new List <string>(); // TODO: Initialize to an appropriate value
            int           invalid_Product_id = BLProduct.ReadAllProduct(ref errors).Count + 1;

            BLProduct.UpdateProduct(-1, "Louis", ref errors);
            Assert.AreEqual(1, errors.Count);
            AsynchLog.LogNow(errors);
            BLProduct.UpdateProduct(invalid_Product_id, "Louis", ref errors);
            Assert.AreEqual(2, errors.Count);
            AsynchLog.LogNow(errors);
        }
Example #2
0
        public void UpdateProductTest()
        {
            Random        rand           = new Random();
            String        updateString   = "Hello Kitty" + rand.Next(1000);
            List <string> errors         = new List <string>(); // TODO: Initialize to an appropriate value
            List <string> errorsExpected = new List <string>(); // TODO: Initialize to an appropriate value
            int           result         = BLProduct.UpdateProduct(1, updateString, ref errors);

            AsynchLog.LogNow(errors);
            ProductInfo Product = BLProduct.ReadProduct(1, ref errors);

            AsynchLog.LogNow(errors);

            Assert.AreEqual(1, result);
            Assert.AreEqual(Product.product_id, 1);
            Assert.AreEqual(Product.product_name, updateString);
        }
Example #3
0
 public int UpdateProduct(int ProductID, string ProductName, ref List <string> errors)
 {
     return(BLProduct.UpdateProduct(ProductID, ProductName, ref errors));
 }
Example #4
0
 public int UpdateProduct(Product obj)
 {
     return(objblproduct.UpdateProduct(obj));
 }