Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
 public async Task AmqpTransportHandler_RejectAsync_TokenCancellationRequested()
 {
     await TestOperationCanceledByToken(token => AmqpTransportHandler.CreateFromConnectionString(DumpyConnectionString).RejectAsync(Guid.NewGuid().ToString(), token));
 }
Example #6
0
 public async Task AmqpTransportHandler_ReceiveAsync_TokenCancellationRequested()
 {
     await TestOperationCanceledByToken(token => AmqpTransportHandler.CreateFromConnectionString(DumpyConnectionString).ReceiveAsync(new TimeSpan(0, 10, 0), token));
 }
Example #7
0
 public async Task AmqpTransportHandler_SendEventAsync_MultipleMessages_TokenCancellationRequested()
 {
     await TestOperationCanceledByToken(token => AmqpTransportHandler.CreateFromConnectionString(DumpyConnectionString).SendEventAsync(new List <Message>(), token));
 }
Example #8
0
 public async Task AmqpTransportHandler_OpenAsync_TokenCancellationRequested()
 {
     await TestOperationCanceledByToken(token => AmqpTransportHandler.CreateFromConnectionString(DumpyConnectionString).OpenAsync(true, token));
 }