Пример #1
0
        public void SetSpecificPropertyOfSingleSmartDevice(string id, string propertyName, string propertyValue)
        {
            ObjectId    _id = ObjectId.Parse(id);
            SmartDevice sd  = _context.GetSingleSmartDeviceFromCollection(_id);

            _context.SetPropertyOfSingleSmartDevice(sd, propertyName, propertyValue);
        }
        public void SetSpecificPropertyOfSingleSmartDevice_WhenPropertIsUnset_ResultIsAsExpected()
        {
            ObjectId newId = ObjectId.Parse("5cab1c94117728a2581069cf");

            SmartDevice smartDevice = new SmartDevice
            {
                Id   = newId,
                Name = "TEST",
            };

            _context.AddSmartDeviceToCollection(smartDevice);

            _context.SetPropertyOfSingleSmartDevice(smartDevice, "Type", "TestType");

            string newType = _context.GetSingleSmartDeviceFromCollection(newId).Type;

            Assert.AreEqual(newType, "TestType");

            _context.DeleteSmartDeviceFromCollection(newId);
        }