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

            BLProductVariation.CreatePV(null, ref errors);
            AsynchLog.LogNow(errors);

            Assert.AreEqual(1, errors.Count);

            errors = new List <string>(); // TODO: Initialize to an appropriate value
            int    invalid_pv_id              = BLProductVariation.ReadAllPV(ref errors).Count + 1;
            int    invalid_product_id         = BLProduct.ReadAllProduct(ref errors).Count + 1;
            int    invalid_brand_id           = BLBrand.ReadAllBrand(ref errors).Count + 1;
            int    invalid_product_color_id   = BLProductColor.ReadAllProductColor(ref errors).Count + 1;
            int    invalid_product_cutting_id = BLProductCutting.ReadAllProductCutting(ref errors).Count + 1;
            char   invalid_sex             = 'Q';
            string invalid_size            = "huge";
            int    invalid_stock           = -1;
            int    invalid_price           = -1;
            char   invalid_condition       = 'f';
            int    invalid_product_type_id = BLProductType.ReadAllProductType(ref errors).Count + 1;

            ProductVariationInfo ipv = new ProductVariationInfo(invalid_pv_id, invalid_product_id, invalid_brand_id, invalid_product_cutting_id, invalid_product_color_id,
                                                                invalid_product_type_id, invalid_sex, invalid_size, invalid_stock, invalid_price, invalid_condition);


            BLProductVariation.CreatePV(ipv, ref errors);
            Assert.AreEqual(8, errors.Count);
            AsynchLog.LogNow(errors);
        }
예제 #2
0
        public void CreateProductColorNullErrorTest()
        {
            List <string> errors         = new List <string>(); // TODO: Initialize to an appropriate value
            List <string> errorsExpected = new List <string>(); // TODO: Initialize to an appropriate value

            BLProductColor.CreateProductColor(null, ref errors);
            AsynchLog.LogNow(errors);

            Assert.AreEqual(1, errors.Count);
        }
예제 #3
0
        public void ProductColorReadErrorTest()
        {
            List <string> errors = new List <string>(); // TODO: Initialize to an appropriate value
            int           invalid_ProductColor_id = BLProductColor.ReadAllProductColor(ref errors).Count + 1;

            BLProductColor.ReadProductColor(invalid_ProductColor_id, ref errors);
            AsynchLog.LogNow(errors);
            BLProductColor.ReadProductColor(-1, ref errors);
            AsynchLog.LogNow(errors);
            Assert.AreEqual(2, errors.Count);
        }
예제 #4
0
        public void UpdateProductColorTest()
        {
            Random        rand           = new Random();
            String        updateString   = "Hello Kitty Pink " + 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         = BLProductColor.UpdateProductColor(1, updateString, ref errors);

            AsynchLog.LogNow(errors);
            ProductColorInfo ProductColor = BLProductColor.ReadProductColor(1, ref errors);

            AsynchLog.LogNow(errors);

            Assert.AreEqual(1, result);
            Assert.AreEqual(ProductColor.product_color_id, 1);
            Assert.AreEqual(ProductColor.product_color_name, updateString);
        }
예제 #5
0
        public void ReadAllProductColorTest()
        {
            List <string>           errors            = new List <string>(); // TODO: Initialize to an appropriate value
            List <string>           errorsExpected    = new List <string>(); // TODO: Initialize to an appropriate value
            List <ProductColorInfo> ProductColorList1 = BLProductColor.ReadAllProductColor(ref errors);

            AsynchLog.LogNow(errors);
            List <ProductColorInfo> ProductColorList2 = BLProductColor.ReadAllProductColor(ref errors);

            AsynchLog.LogNow(errors);

            Assert.AreEqual(ProductColorList1.Count, ProductColorList2.Count);
            Assert.AreEqual(errors.Count, 0);
            for (int i = 0; i < ProductColorList1.Count; i++)
            {
                Assert.AreEqual(ProductColorList1[i].product_color_id, ProductColorList2[i].product_color_id);
                Assert.AreEqual(ProductColorList1[i].product_color_name, ProductColorList2[i].product_color_name);
            }
        }
예제 #6
0
        public void CreateProductColorErrorTest()
        {
            List <string> errors         = new List <string>(); // TODO: Initialize to an appropriate value
            List <string> errorsExpected = new List <string>(); // TODO: Initialize to an appropriate value

            BLProductColor.CreateProductColor(null, ref errors);

            Assert.AreEqual(1, errors.Count);
            AsynchLog.LogNow(errors);

            errors = new List <string>(); // TODO: Initialize to an appropriate value

            Random rand = new Random();
            string iProductColorName = "Louis" + rand.Next(1000);

            BLProductColor.CreateProductColor(iProductColorName, ref errors);
            AsynchLog.LogNow(errors);
            BLProductColor.CreateProductColor(iProductColorName, ref errors);
            AsynchLog.LogNow(errors);
            Assert.AreEqual(1, errors.Count);
        }
예제 #7
0
        public void CreateProductColorTest()
        {
            Random rand         = new Random();
            String createString = "Sanrio Pink " + 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         = BLProductColor.CreateProductColor(createString, ref errors);

            AsynchLog.LogNow(errors);
            Assert.AreNotEqual(result, -1);
            System.Diagnostics.Debug.WriteLine("RESULT:" + result);
            ProductColorInfo ProductColor = BLProductColor.ReadProductColor(result, ref errors);

            AsynchLog.LogNow(errors);

            System.Diagnostics.Debug.WriteLine("RESULT:" + ProductColor.product_color_id);
            System.Diagnostics.Debug.WriteLine("RESULT:" + ProductColor.product_color_name);

            Assert.AreEqual(ProductColor.product_color_id, result);
            Assert.AreEqual(ProductColor.product_color_name, createString);
        }
예제 #8
0
 public List <ProductColorInfo> ReadAllProductColor(ref List <string> errors)
 {
     return(BLProductColor.ReadAllProductColor(ref errors));
 }
예제 #9
0
 public int UpdateProductColor(int ProductColorID, string ProductColorName, ref List <string> errors)
 {
     return(BLProductColor.UpdateProductColor(ProductColorID, ProductColorName, ref errors));
 }
예제 #10
0
 public int CreateProductColor(string ProductColorName, ref List <string> errors)
 {
     return(BLProductColor.CreateProductColor(ProductColorName, ref errors));
 }
예제 #11
0
 public ProductColorInfo ReadProductColor(int id, ref List <string> errors)
 {
     return(BLProductColor.ReadProductColor(id, ref errors));
 }