Exemplo n.º 1
0
        public void GetId_ItemsInstantiateWithAnIdAndGetterReturns_Int()
        {
            CampingItems newItem = new CampingItems("flashlight", 4, 11, true, "Noah");
            int          result  = newItem.Id;

            Assert.AreEqual(1, result);
        }
Exemplo n.º 2
0
        public void Find_ReturnsCorrectItem_Item()
        {
            //Arrange
            CampingItems newItem  = new CampingItems("flashlight", 4, 11, true, "Noah");
            CampingItems newItem2 = new CampingItems("backpack", 6, 15, true, "Isaac");

            //Act
            CampingItems result = CampingItems.Find(2);

            //Assert
            Assert.AreEqual(newItem2.Item, result.Item);
        }
        public ActionResult Index()
        {
            List <CampingItems> allItems = CampingItems.GetAll();

            return(View(allItems));
        }
        public ActionResult Show(int id)
        {
            CampingItems foundItem = CampingItems.Find(id);

            return(View(foundItem));
        }
 public ActionResult DeleteAll()
 {
     CampingItems.ClearAll();
     return(View());
 }
        public ActionResult Create(string item, int price, int weight, bool packed, string name)
        {
            CampingItems myItem = new CampingItems(item, price, weight, packed, name);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 7
0
 public void Dispose()
 {
     CampingItems.ClearAll();
 }