Exemplo n.º 1
0
        public IActionResult SearchById(int id)
        {
            var item = _itemDb.GetById(id);
            ListItemDiscount listItemDiscount = new ListItemDiscount();

            listItemDiscount.Discount = false;
            if (item != null && IsPalindromeInt(id))
            {
                item.price = item.price / 2;
                listItemDiscount.Discount = true;
            }
            List <Item> itemList = new List <Item>()
            {
                item
            };

            listItemDiscount.ItemList = itemList;
            return(View(listItemDiscount));
        }
Exemplo n.º 2
0
        public void TestGetById()
        {
            Item item = _testItemDb.GetById(121);

            Assert.True(AreEqualItems(item, _item1));
        }