public void Type_TestingTypeIsPublic_TypeIsSavedInClass() { Style target = new Style(); 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(Style style) { if (ModelState.IsValid) { db.Styles.Add(style); db.SaveChanges(); return RedirectToAction("Index"); } return View(style); }
public void GiftTypeID_TestingIdIsPublic_IdIsSavedInClass() { Style target = new Style(); Random random = new Random(); for (int counter = 0; counter < 10; counter++) { int testId = random.Next(); target.StyleID = testId; Assert.AreEqual(testId, target.StyleID); } }
public ActionResult Edit(Style style) { if (ModelState.IsValid) { db.Entry(style).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(style); }
public void StyleConstructor_Null_NoCategoriesCreated() { Style target = new Style(); Assert.AreEqual(0, target.Categories.Count); }