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 void AddSmartDevice(string type, string name, string state, string localization, bool disabled) { SmartDevice sd = new SmartDevice { Type = type, Name = name, Localization = localization, Disabled = disabled, State = state, }; _context.AddSmartDeviceToCollection(sd); }