Example #1
0
        public void CreateProductNullErrorTest()
        {
            List <string> errors         = new List <string>(); // TODO: Initialize to an appropriate value
            List <string> errorsExpected = new List <string>(); // TODO: Initialize to an appropriate value

            BLProduct.CreateProduct(null, ref errors);
            AsynchLog.LogNow(errors);

            Assert.AreEqual(1, errors.Count);
        }
Example #2
0
        public void CreateProductTest()
        {
            Random rand         = new Random();
            String createString = "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.CreateProduct(createString, ref errors);

            Assert.AreNotEqual(result, -1);
            AsynchLog.LogNow(errors);

            ProductInfo Product = BLProduct.ReadProduct(result, ref errors);

            AsynchLog.LogNow(errors);

            Assert.AreEqual(Product.product_id, result);
            Assert.AreEqual(Product.product_name, createString);
        }
Example #3
0
        public void CreateProductErrorTest()
        {
            List <string> errors         = new List <string>(); // TODO: Initialize to an appropriate value
            List <string> errorsExpected = new List <string>(); // TODO: Initialize to an appropriate value

            BLProduct.CreateProduct(null, ref errors);
            AsynchLog.LogNow(errors);

            Assert.AreEqual(1, errors.Count);

            errors = new List <string>(); // TODO: Initialize to an appropriate value
            Random rand         = new Random();
            string iProductName = "Louis" + rand.Next(1000);

            BLProduct.CreateProduct(iProductName, ref errors);
            AsynchLog.LogNow(errors);
            BLProduct.CreateProduct(iProductName, ref errors);
            AsynchLog.LogNow(errors);
            Assert.AreEqual(1, errors.Count);
        }
Example #4
0
 public int CreateProduct(string ProductName, ref List <string> errors)
 {
     return(BLProduct.CreateProduct(ProductName, ref errors));
 }