public void ProductCuttingReadErrorTest() { List <string> errors = new List <string>(); // TODO: Initialize to an appropriate value int invalid_ProductCutting_id = BLProductCutting.ReadAllProductCutting(ref errors).Count + 1; BLProductCutting.ReadProductCutting(invalid_ProductCutting_id, ref errors); AsynchLog.LogNow(errors); BLProductCutting.ReadProductCutting(-1, ref errors); AsynchLog.LogNow(errors); Assert.AreEqual(2, errors.Count); }
public void UpdateProductCuttingTest() { Random rand = new Random(); String updateString = "Tall " + 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 = BLProductCutting.UpdateProductCutting(1, updateString, ref errors); AsynchLog.LogNow(errors); ProductCuttingInfo ProductCutting = BLProductCutting.ReadProductCutting(1, ref errors); AsynchLog.LogNow(errors); Assert.AreEqual(1, result); Assert.AreEqual(ProductCutting.product_cutting_id, 1); Assert.AreEqual(ProductCutting.product_cutting_name, updateString); }
public void CreateProductCuttingTest() { Random rand = new Random(); String createString = "Midget " + 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 = BLProductCutting.CreateProductCutting(createString, ref errors); AsynchLog.LogNow(errors); Assert.AreNotEqual(result, -1); ProductCuttingInfo ProductCutting = BLProductCutting.ReadProductCutting(result, ref errors); AsynchLog.LogNow(errors); Assert.AreEqual(ProductCutting.product_cutting_id, result); Assert.AreEqual(ProductCutting.product_cutting_name, createString); }
public ProductCuttingInfo ReadProductCutting(int id, ref List <string> errors) { return(BLProductCutting.ReadProductCutting(id, ref errors)); }