public void AddSmartDeviceToCollection_CheckIfSmartDeviceIsAddedToDatabase() { SmartDevice smartDevice = new SmartDevice { Id = ObjectId.Parse("5cab1c95187374a2581069cf"), Name = "TEST" }; _context.AddSmartDeviceToCollection(smartDevice); var result = _context.GetSmartDevicesCollection("Name"); var addedSmartDevice = result.Where(z => z.Id == smartDevice.Id).FirstOrDefault(); Assert.That(() => addedSmartDevice != null); _context.DeleteSmartDeviceFromCollection(smartDevice.Id); }
public List <SmartDevice> GetAllSmartDevices(string propertyName = "Type") { List <SmartDevice> SmartDevicesList = _context.GetSmartDevicesCollection(propertyName).ToList(); return(SmartDevicesList); }