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); }
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); }
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); }
public int CreateProduct(string ProductName, ref List <string> errors) { return(BLProduct.CreateProduct(ProductName, ref errors)); }