public void BrandReadErrorTest() { List <string> errors = new List <string>(); // TODO: Initialize to an appropriate value int invalid_Brand_id = BLBrand.ReadAllBrand(ref errors).Count + 1; BLBrand.ReadBrand(invalid_Brand_id, ref errors); BLBrand.ReadBrand(-1, ref errors); Assert.AreEqual(2, errors.Count); AsynchLog.LogNow(errors); }
public void UpdateBrandTest() { 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 = BLBrand.UpdateBrand(1, updateString, ref errors); BrandInfo Brand = BLBrand.ReadBrand(1, ref errors); AsynchLog.LogNow(errors); Assert.AreEqual(1, result); Assert.AreEqual(Brand.brand_id, 1); Assert.AreEqual(Brand.brand_name, updateString); }
public void CreateBrandTest() { Random rand = new Random(); String createString = "Sanrio " + 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 = BLBrand.CreateBrand(createString, ref errors); Assert.AreNotEqual(result, -1); BrandInfo Brand = BLBrand.ReadBrand(result, ref errors); AsynchLog.LogNow(errors); Assert.AreEqual(Brand.brand_id, result); Assert.AreEqual(Brand.brand_name, createString); }
public BrandInfo ReadBrand(int id, ref List <string> errors) { return(BLBrand.ReadBrand(id, ref errors)); }