Example #1
0
        public void UpdateSpecificItemWithWrongId()
        {
            var item = new GestionaryWebsite.Dbo.ClientItems {
                Id = 7, Name = "ItemName", PicName = "PicName.jpg", Price = 10, Stock = 20, TypeId = 1
            };
            var updated = _stockRepository.Update(item).Result;

            Assert.AreEqual(null, updated);
        }
Example #2
0
        public void InsertItem()
        {
            var item = new GestionaryWebsite.Dbo.ClientItems {
                Id = 5, Name = "ItemName", PicName = "PicName.jpg", Price = 10, Stock = 20, TypeId = 1
            };
            var res = _stockRepository.Insert(item).Result;

            Assert.AreEqual(5, res.Id);
            Assert.AreEqual("ItemName", res.Name);
            Assert.AreEqual("PicName.jpg", res.PicName);
            Assert.AreEqual(10, res.Price);
            Assert.AreEqual(20, res.Stock);
            Assert.AreEqual(1, res.TypeId);
        }
Example #3
0
        public void UpdateSpecificItem()
        {
            var item = new GestionaryWebsite.Dbo.ClientItems {
                Id = 1, Name = "ItemName", PicName = "PicName.jpg", Price = 10, Stock = 20, TypeId = 1
            };
            var updated = _stockRepository.Update(item).Result;

            var res = _context.Items.Find((long)1);

            Assert.AreEqual(1, res.Id);
            Assert.AreEqual("ItemName", res.Name);
            Assert.AreEqual("PicName.jpg", res.PicName);
            Assert.AreEqual(10, res.Price);
            Assert.AreEqual(20, res.Stock);
            Assert.AreEqual(1, res.TypeId);
        }