Example #1
0
        public void Type_TestingTypeIsPublic_TypeIsSavedInClass()
        {
            Style target = new Style();
            target.Type = testString;

            Assert.AreEqual(testString, target.Type);
        }
Example #2
0
        public void Styles_AddCategory_OneCategoryInCategory()
        {
            Style style = new Style();
            Category target = new Category();
            target.Styles.Add(style);

            Assert.AreEqual(1, target.Styles.Count);
        }
Example #3
0
        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);
        }
Example #5
0
        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);
 }
Example #7
0
        public void StyleConstructor_Null_NoCategoriesCreated()
        {
            Style target = new Style();

            Assert.AreEqual(0, target.Categories.Count);
        }