public void PreTestingInitialize()
        {
            category_mock.Setup(x => x.List()).Returns(new Category[] {
            new Category() { NameEn = "Green",ID=1 },
            new Category() { NameEn = "Blue", ID=2 }
              });

            Subcategory[] sub = new Subcategory[] {
            new Subcategory() { NameEn = "LG",ID=1 },
            new Subcategory() { NameEn = "Nokia", ID=2 }
              };
        }
示例#2
0
 public ActionResult Create(Subcategory subcategory)
 {
     if (ModelState.IsValid)
     {
         subcategoryRepository.Insert(subcategory);
         subcategoryRepository.Save();
         return RedirectToAction("Index");
     }
     else
     {
         return View();
     }
 }
示例#3
0
 public void Insert(Subcategory subcategory)
 {
     entities.Subcategories.Add(subcategory);
 }