public void DeviceClient_ConnectionString_DeviceScope_ExplicitSharedAccessSignatureCredentialType_Test() { string connectionString = "HostName=acme.azure-devices.net;CredentialScope=Device;CredentialType=SharedAccessSignature;DeviceId=device1;SharedAccessSignature=SharedAccessSignature sr=dh%3a%2f%2facme.azure-devices.net&sig=poifbMLdBGtCJknubF2FW6FLn5vND5k1IKoeQ%2bONgkE%3d&se=87824124985&skn=AllAccessKey"; var deviceClient = AmqpTransportHandler.CreateFromConnectionString(connectionString); Assert.IsNotNull(deviceClient.Connection); Assert.IsNotNull(deviceClient.Connection.ConnectionString); }
public void DeviceClient_ConnectionString_IotHubScope_SharedAccessKeyCredentialType_Test() { string connectionString = "HostName=acme.azure-devices.net;DeviceId=device1;SharedAccessKeyName=AllAccessKey;SharedAccessKey=CQN2K33r45/0WeIjpqmErV5EIvX8JZrozt3NEHCEkG8="; var deviceClient = AmqpTransportHandler.CreateFromConnectionString(connectionString); Assert.IsNotNull(deviceClient.IotHubConnection); Assert.IsNotNull(((IotHubSingleTokenConnection)deviceClient.IotHubConnection).ConnectionString); }
public void DeviceClient_ConnectionString_DeviceScope_ImplicitSharedAccessSignatureCredentialType_Test() { string connectionString = "HostName=acme.azure-devices.net;CredentialScope=Device;CredentialType=SharedAccessSignature;DeviceId=device1;SharedAccessKey=CQN2K33r45/0WeIjpqmErV5EIvX8JZrozt3NEHCEkG8="; var deviceClient = AmqpTransportHandler.CreateFromConnectionString(connectionString); Assert.IsNotNull(deviceClient.Connection); Assert.IsNotNull(deviceClient.Connection.ConnectionString); }
public void DeviceClient_ConnectionString_DefaultScope_DefaultCredentialType_Test() { string connectionString = "HostName=acme.azure-devices.net;SharedAccessKeyName=AllAccessKey;DeviceId=device1;SharedAccessKey=CQN2K33r45/0WeIjpqmErV5EIvX8JZrozt3NEHCEkG8="; var deviceClient = AmqpTransportHandler.CreateFromConnectionString(connectionString); Assert.IsNotNull(deviceClient.Connection); Assert.IsNotNull(deviceClient.Connection.ConnectionString); var iotHubConnectionStringBuilder = IotHubConnectionStringBuilder.Create(connectionString); }
public async Task AmqpTransportHandler_RejectAsync_TokenCancellationRequested() { await TestOperationCanceledByToken(token => AmqpTransportHandler.CreateFromConnectionString(DumpyConnectionString).RejectAsync(Guid.NewGuid().ToString(), token)); }
public async Task AmqpTransportHandler_ReceiveAsync_TokenCancellationRequested() { await TestOperationCanceledByToken(token => AmqpTransportHandler.CreateFromConnectionString(DumpyConnectionString).ReceiveAsync(new TimeSpan(0, 10, 0), token)); }
public async Task AmqpTransportHandler_SendEventAsync_MultipleMessages_TokenCancellationRequested() { await TestOperationCanceledByToken(token => AmqpTransportHandler.CreateFromConnectionString(DumpyConnectionString).SendEventAsync(new List <Message>(), token)); }
public async Task AmqpTransportHandler_OpenAsync_TokenCancellationRequested() { await TestOperationCanceledByToken(token => AmqpTransportHandler.CreateFromConnectionString(DumpyConnectionString).OpenAsync(true, token)); }