public void MatchColorReturnTrueWhenTemplateContainColorName() { var template = new TemplateProductView(); template.ColorName = "YELLOW RED"; Assert.AreEqual(false, categoryDao.matchColor(template, "RED")); }
public void MatchColorReturnFalseWhenTemplateNotContainColorName() { var template = new TemplateProductView(); template.ColorName = "RED"; Assert.AreEqual(false, categoryDao.matchColor(template, "BLACK")); }
public void MatchContentReturnTrueWhenTemplateContainContent() { var template = new TemplateProductView(); template.Name = "ABC"; template.Descriptions = "DEF"; Assert.AreEqual(false, categoryDao.matchContent(template, "BC")); }
public void MatchCotentReturnFalseWhenTemplateNotContainCotent() { var template = new TemplateProductView(); template.Name = "A"; template.Descriptions = "B"; Assert.AreEqual(false, categoryDao.matchContent(template, "D")); }
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); }
public bool matchCategory(TemplateProductView template, string categoryID) { int ID = int.Parse(categoryID.Trim()); return(template.CategoryID == ID); }
public bool matchContent(TemplateProductView template, string content) { return(template.Name.Trim().ToLower().Contains(content) || template.Descriptions.Trim().ToLower().Contains(content)); }
public bool matchColor(TemplateProductView template, string colorName) { return(template.ColorName.Trim().ToLower().Contains(colorName)); }