示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
 public BrandInfo ReadBrand(int id, ref List <string> errors)
 {
     return(BLBrand.ReadBrand(id, ref errors));
 }