public async Task delete_multiple_iotHub_devices() { DeviceTwinRepository repo = new DeviceTwinRepository(iotHubConnectionString); var device1 = await repo.CreateDevice("coffeemaker1"); var device2 = await repo.CreateDevice("coffeemaker2"); var device3 = await repo.CreateDevice("coffeemaker3"); List <string> devices = new List <string> { device1.Id, device2.Id, device3.Id }; await repo.DeleteMultipleDevicesAsync(devices); var getDevice1 = await repo.GetDevice(device1.Id); Assert.Null(getDevice1); var getDevice2 = await repo.GetDevice(device2.Id); Assert.Null(getDevice2); var getDevice3 = await repo.GetDevice(device3.Id); Assert.Null(getDevice3); }
public async Task get_iotHub_device() { DeviceTwinRepository repo = new DeviceTwinRepository(iotHubConnectionString); var tags = new DeviceTwinTagsModel() { ProductFamily = "ProductFamilyTest", ProductName = "ProductNameTest", RetailerName = "RetailerTest", ManufacturedDate = DateTime.Now, ShippedDate = DateTime.Now, RetailerRegion = "Chicago" }; var device = await repo.CreateAndInitializeDeviceTwin("unittestdevice", tags); var deviceFound = await repo.GetDevice("unittestdevice"); Assert.Equal("unittestdevice", deviceFound.Id); }