Beispiel #1
0
        public void CheckUpdatingDevice()
        {
            var newDevice = new Device
            {
                ProductIdentificator = 1,
                Name             = "GasCooker",
                ProducingCountry = "Italy",
                Price            = 38.6,
                Rating           = 49
            };

            _deviceShop.UpdateItem(newDevice);
            Assert.AreEqual(1, _deviceShop.GetNumberOfItems());
            var receivedDevice = _deviceShop.GetItem(newDevice.ProductIdentificator);

            Assert.AreEqual("GasCooker", receivedDevice.Name);
            Assert.AreEqual(38.6, receivedDevice.Price);
            Assert.AreEqual(49, receivedDevice.Rating);
            Assert.AreEqual("Italy", receivedDevice.ProducingCountry);
        }
Beispiel #2
0
 public List <IDevice> UpdateDevice([FromBody] Device newDevice)
 {
     _deviceShop.UpdateItem(newDevice);
     return(_deviceShop.GetItems());
 }