public async Task GetDeviceAsyncWithNullDeviceIdTest()
 {
     var restOpMock = new Mock<IHttpClientHelper>();
     var registryManager = new HttpRegistryManager(restOpMock.Object, IotHubName);
     await registryManager.GetDeviceAsync(null);
     Assert.Fail("Calling GetDeviceAsync with null device id did not throw an exception.");
 }
        public async Task GetDeviceAsyncTest()
        {
            const string DeviceId = "123";
            var deviceToReturn = new Device(DeviceId) { ConnectionState = DeviceConnectionState.Connected };
            var restOpMock = new Mock<IHttpClientHelper>();
            restOpMock.Setup(restOp => restOp.GetAsync<Device>(It.IsAny<Uri>(), It.IsAny<IDictionary<HttpStatusCode, Func<HttpResponseMessage, Task<Exception>>>>(), null, false, It.IsAny<CancellationToken>())).ReturnsAsync(deviceToReturn);

            var registryManager = new HttpRegistryManager(restOpMock.Object, IotHubName);
            var device = await registryManager.GetDeviceAsync(DeviceId);
            Assert.AreSame(deviceToReturn, device);
            restOpMock.VerifyAll();
        }