in DeviceBridgeTests/Providers/StorageProviderTests.cs [86:103]
public async Task ListDeviceSubscriptions()
{
using (ShimsContext.Create())
{
_encriptionServiceMock.Invocations.Clear();
ShimOpen();
ShimExecuteReader("SELECT * FROM DeviceSubscriptions WHERE DeviceId = @DeviceId", new Dictionary<string, string>() { { "DeviceId", "test-device" } });
ShimRead(1);
var testDateTime = DateTime.Now;
ShimItemGetString(GetTestSubscription(testDateTime));
var result = await _storageProvider.ListDeviceSubscriptions(LogManager.GetCurrentClassLogger(), "test-device");
Assert.AreEqual(1, result.Count);
Assert.True(result[0].DeviceId == "test-device" && result[0].CallbackUrl == "http://test" && result[0].SubscriptionType == DeviceSubscriptionType.DesiredProperties && result[0].CreatedAt == testDateTime);
_encriptionServiceMock.Verify(p => p.Decrypt(It.IsAny<Logger>(), "http://test"), Times.Once());
}
}