Beispiel #1
0
        public string Bind(IReadOnlyDictionary <string, object> bindingData)
        {
            IReadOnlyDictionary <string, string> parameters = BindingDataPath.ConvertParameters(bindingData);
            string tableName = _template.Bind(parameters);

            TableClient.ValidateAzureTableName(tableName);

            return(tableName);
        }
        public void ConvertParamValueToString_IfUnupportedType_ReturnsNull()
        {
            // Arrange
            DateTime dateTimeParam = DateTime.Now;

            // Act
            string stringParamValue = BindingDataPath.ConvertParameterValueToString(dateTimeParam);

            // Assert
            Assert.Null(stringParamValue);
        }
        public BlobPath Bind(IReadOnlyDictionary <string, object> bindingData)
        {
            IReadOnlyDictionary <string, string> parameters = BindingDataPath.ConvertParameters(bindingData);
            string containerName = _containerNameTemplate.Bind(parameters);
            string blobName      = _blobNameTemplate.Bind(parameters);

            BlobClient.ValidateContainerName(containerName);
            BlobClient.ValidateBlobName(blobName);

            return(new BlobPath(containerName, blobName));
        }
        public void ConvertParamValueToString_IfStringParam_ReturnsStringValue()
        {
            // Arrange
            const string expectedStringValue = "Some random test string";

            // Act
            string stringParamValue = BindingDataPath.ConvertParameterValueToString(expectedStringValue);

            // Assert
            Assert.NotNull(stringParamValue);
            Assert.Equal(expectedStringValue, stringParamValue);
        }
        public string Bind(IReadOnlyDictionary <string, object> bindingData)
        {
            if (bindingData == null)
            {
                throw new ArgumentNullException("bindingData");
            }

            IReadOnlyDictionary <string, string> parameters = BindingDataPath.ConvertParameters(bindingData);
            string queueOrTopicName = _template.Bind(parameters);

            return(queueOrTopicName);
        }
Beispiel #6
0
        public string Bind(IReadOnlyDictionary <string, object> bindingData)
        {
            if (bindingData == null)
            {
                throw new ArgumentNullException("bindingData");
            }

            IReadOnlyDictionary <string, string> parameters = BindingDataPath.ConvertParameters(bindingData);
            string queueName = _template.Bind(parameters);

            return(BindableQueuePath.NormalizeAndValidate(queueName));
        }
        public void ConvertParamValueToString_IfGuidParam_ReturnsStringValue()
        {
            // Arrange
            string expectedStringValue = "c914be08-fae6-4014-a619-c5f7ebf3fe37";
            Guid   guidParam           = Guid.Parse(expectedStringValue);

            // Act
            string stringParamValue = BindingDataPath.ConvertParameterValueToString(guidParam);

            // Assert
            Assert.NotNull(stringParamValue);
            Assert.Equal(expectedStringValue, stringParamValue);
        }
        public void ConvertParamValueToString_IfSupportedType_ReturnsStringValue(Type paramType, string expectedStringValue)
        {
            // Arrange
            var    parseMethod = paramType.GetMethod("Parse", new Type[] { typeof(string) });
            object paramValue  = parseMethod.Invoke(null, new object[] { expectedStringValue });

            // Act
            string stringParamValue = BindingDataPath.ConvertParameterValueToString(paramValue);

            // Assert
            Assert.NotNull(stringParamValue);
            Assert.Equal(expectedStringValue, stringParamValue);
        }
        public TableEntityPath Bind(IReadOnlyDictionary <string, object> bindingData)
        {
            IReadOnlyDictionary <string, string> parameters = BindingDataPath.ConvertParameters(bindingData);
            string tableName    = _tableNameTemplate.Bind(parameters);
            string partitionKey = _partitionKeyTemplate.Bind(parameters);
            string rowKey       = _rowKeyTemplate.Bind(parameters);

            TableClient.ValidateAzureTableName(tableName);
            TableClient.ValidateAzureTableKeyValue(partitionKey);
            TableClient.ValidateAzureTableKeyValue(rowKey);

            return(new TableEntityPath(tableName, partitionKey, rowKey));
        }