Ejemplo n.º 1
0
        public void MatchColorReturnTrueWhenTemplateContainColorName()
        {
            var template = new TemplateProductView();

            template.ColorName = "YELLOW RED";
            Assert.AreEqual(false, categoryDao.matchColor(template, "RED"));
        }
Ejemplo n.º 2
0
        public void MatchColorReturnFalseWhenTemplateNotContainColorName()
        {
            var template = new TemplateProductView();

            template.ColorName = "RED";
            Assert.AreEqual(false, categoryDao.matchColor(template, "BLACK"));
        }
Ejemplo n.º 3
0
        public void MatchContentReturnTrueWhenTemplateContainContent()
        {
            var template = new TemplateProductView();

            template.Name         = "ABC";
            template.Descriptions = "DEF";
            Assert.AreEqual(false, categoryDao.matchContent(template, "BC"));
        }
Ejemplo n.º 4
0
        public void MatchCotentReturnFalseWhenTemplateNotContainCotent()
        {
            var template = new TemplateProductView();

            template.Name         = "A";
            template.Descriptions = "B";
            Assert.AreEqual(false, categoryDao.matchContent(template, "D"));
        }
Ejemplo n.º 5
0
        public bool matchSize(TemplateProductView template, string size)
        {
            var model =
                db.ProductSizeViews.AsNoTracking().Where(p => p.ShoeID == template.ShoeID).ToList();

            foreach (var item in model)
            {
                if (double.Parse(item.Number.ToString()) == double.Parse(size))
                {
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 6
0
        public bool matchCategory(TemplateProductView template, string categoryID)
        {
            int ID = int.Parse(categoryID.Trim());

            return(template.CategoryID == ID);
        }
Ejemplo n.º 7
0
 public bool matchContent(TemplateProductView template, string content)
 {
     return(template.Name.Trim().ToLower().Contains(content) ||
            template.Descriptions.Trim().ToLower().Contains(content));
 }
Ejemplo n.º 8
0
 public bool matchColor(TemplateProductView template, string colorName)
 {
     return(template.ColorName.Trim().ToLower().Contains(colorName));
 }