public void TestCategoryNameValidatorEmpty() { string category = String.Empty; CategoryName categName = new CategoryName(); Assert.IsFalse(categName.CategoryNameValidator(category)); }
public void TestCategoryNameValidator() { string category = "Games"; CategoryName categName = new CategoryName(); Assert.IsTrue(categName.CategoryNameValidator(category)); }
public void TestCategoryNameValidatorFalse() { string category = "Játé kok"; CategoryName categName = new CategoryName(); Assert.IsFalse(categName.CategoryNameValidator(category)); }
public ActionResult Create([Bind(Include = "Category_Name")] CategoryName categoryName) { if (ModelState.IsValid) { if (categoryName.CategoryNameValidator(categoryName.Category_Name)) { db.CategoryNames.Add(categoryName); db.SaveChanges(); } return(RedirectToAction("Index")); } return(View(categoryName)); }