public void Type_TestingTypeIsPublic_TypeIsSavedInClass() { Category target = new Category(); target.Type = testString; Assert.AreEqual(testString, target.Type); }
public void Styles_AddCategory_OneCategoryInCategory() { Style style = new Style(); Category target = new Category(); target.Styles.Add(style); Assert.AreEqual(1, target.Styles.Count); }
public void Categories_AddCategory_OneCategoryInStyle() { Category category = new Category(); Style target = new Style(); target.Categories.Add(category); Assert.AreEqual(1, target.Categories.Count); }
public ActionResult Create(Category category) { if (ModelState.IsValid) { db.Categories.Add(category); db.SaveChanges(); return RedirectToAction("Index"); } return View(category); }
public void CategoryID_TestingIdIsPublic_IdIsSavedInClass() { Category target = new Category(); Random random = new Random(); for(int counter = 0; counter < 10; counter++) { int testId = random.Next(); target.CategoryID = testId; Assert.AreEqual(testId, target.CategoryID); } }
public void CategoryConstructor_Null_NoStylesCreated() { Category target = new Category(); Assert.AreEqual(0, target.Styles.Count); }
public ActionResult Edit(Category category) { if (ModelState.IsValid) { db.Entry(category).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(category); }