public bool CheckIfSingleSmartDeviceIsDisabled(string id) { ObjectId _id = ObjectId.Parse(id); SmartDevice sd = _context.GetSingleSmartDeviceFromCollection(_id); return(sd.Disabled); }
public void ChangeSmartDeviceState_WhenStateIsNull_ResultIsEqual() { ObjectId newId = ObjectId.Parse("5cab1c93187378a2581069cf"); SmartDevice smartDevice = new SmartDevice { Id = newId, Name = "TEST", State = null }; _context.AddSmartDeviceToCollection(smartDevice); _context.ChangeSmartDeviceState(smartDevice, "TEST"); var result = _context.GetSingleSmartDeviceFromCollection(newId); var resultState = result.State; Assert.AreEqual(resultState, "TEST"); _context.DeleteSmartDeviceFromCollection(newId); }