Beispiel #1
0
        public void Find_FindsItemByIdField_CampingItem()
        {
            //Arrange
            string      item        = "chair";
            string      price       = "$3.00";
            string      weight      = "2 pounds";
            string      name        = "person";
            CampingItem campingItem = new CampingItem(item, price, weight, name);
            //Act
            CampingItem foundItem = CampingItem.Find(1);


            //Assert
            Assert.AreEqual(1, foundItem.Id);
        }
Beispiel #2
0
        public ActionResult Detail(int id)
        {
            CampingItem currentItem = CampingItem.Find(id);

            return(View(currentItem));
        }
Beispiel #3
0
        public ActionResult Create(string item, string price, string weight, string name)
        {
            CampingItem campingItem = new CampingItem(item, price, weight, name);

            return(RedirectToAction("Index"));
        }
Beispiel #4
0
 public ActionResult DeleteAll()
 {
     CampingItem.ClearAll();
     return(RedirectToAction("Index"));
 }
Beispiel #5
0
        public ActionResult Index()
        {
            List <CampingItem> allItems = CampingItem.GetAll();

            return(View(allItems));
        }