public Task <IValueProvider> BindAsync(BindingContext context) { string boundQueueName = _path.Bind(context.BindingData); IStorageQueue queue = _client.GetQueueReference(boundQueueName); return(BindQueueAsync(queue, context.ValueContext)); }
public void Bind_IfNullBindingData_Throws() { const string queueNamePattern = "queue-{name}-with-{parameter}"; IBindableQueuePath path = CreateProductUnderTest(queueNamePattern); ExceptionAssert.ThrowsArgumentNull(() => path.Bind(null), "bindingData"); }
public void Bind_IfNotNullBindingData_ReturnsResolvedQueueName() { const string queueNamePattern = "queue-{name}-with-{parameter}"; var bindingData = new Dictionary <string, object> { { "name", "name" }, { "parameter", "parameter" } }; IBindableQueuePath path = CreateProductUnderTest(queueNamePattern); string result = path.Bind(bindingData); Assert.Equal("queue-name-with-parameter", result); }
public Task <IValueProvider> BindAsync(BindingContext context) { if (context == null) { throw new ArgumentNullException("context"); } string boundQueueName = _path.Bind(context.BindingData); IStorageQueue queue = _client.GetQueueReference(boundQueueName); return(BindQueueAsync(queue, context.ValueContext)); }
public IStorageQueue Convert(string input) { string queueName; // For convenience, treat an an empty string as a request for the default value. if (String.IsNullOrEmpty(input) && _defaultPath.IsBound) { queueName = _defaultPath.Bind(null); } else { queueName = BindableQueuePath.NormalizeAndValidate(input); } return(_client.GetQueueReference(queueName)); }