public async Task DeleteDevicesAsyncWithDeviceIdNullTest()
 {
     var goodDevice = new Device("123") { ConnectionState = DeviceConnectionState.Connected, ETag = "234" };
     var badDevice = new Device();
     var restOpMock = new Mock<IHttpClientHelper>();
     var registryManager = new HttpRegistryManager(restOpMock.Object, IotHubName);
     await registryManager.RemoveDevicesAsync(new List<Device>() { goodDevice, badDevice });
     Assert.Fail("DeleteDevices API did not throw exception when deviceId was null.");
 }
        public async Task DeleteDevicesAsyncForceDeleteFalseTest()
        {
            var goodDevice1 = new Device("123") { ConnectionState = DeviceConnectionState.Connected, ETag = "234" };
            var goodDevice2 = new Device("234") { ConnectionState = DeviceConnectionState.Connected, ETag = "123" };
            var restOpMock = new Mock<IHttpClientHelper>();
            restOpMock.Setup(restOp => restOp.PostAsync<IEnumerable<ExportImportDevice>, Task<string[]>>(It.IsAny<Uri>(), It.IsAny<IEnumerable<ExportImportDevice>>(), It.IsAny<IDictionary<HttpStatusCode, Func<HttpResponseMessage, Task<Exception>>>>(), It.IsAny<IDictionary<string, string>>(), It.IsAny<CancellationToken>())).ReturnsAsync(null);

            var registryManager = new HttpRegistryManager(restOpMock.Object, IotHubName);
            await registryManager.RemoveDevicesAsync(new List<Device>() { goodDevice1, goodDevice2 }, false, CancellationToken.None);
        }
 public async Task DeleteDevicesAsyncWithNullDeviceListTest()
 {
     var restOpMock = new Mock<IHttpClientHelper>();
     var registryManager = new HttpRegistryManager(restOpMock.Object, IotHubName);
     await registryManager.RemoveDevicesAsync(new List<Device>());
     Assert.Fail("DeleteDevices API did not throw exception when Null device list was used.");
 }