Ejemplo n.º 1
0
        public void Type_TestingTypeIsPublic_TypeIsSavedInClass()
        {
            Style target = new Style();
            target.Type = testString;

            Assert.AreEqual(testString, target.Type);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
        public ActionResult Create(Style style)
        {
            if (ModelState.IsValid)
            {
                db.Styles.Add(style);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(style);
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 6
0
 public ActionResult Edit(Style style)
 {
     if (ModelState.IsValid)
     {
         db.Entry(style).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(style);
 }
Ejemplo n.º 7
0
        public void StyleConstructor_Null_NoCategoriesCreated()
        {
            Style target = new Style();

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