public void GetCloudTable_HandlesInvalidTableName()
        {
            // Act
            var ex = Assert.Throws <InvalidOperationException>(() => _manager.GetCloudTable("UseDevelopmentStorage=true;", "I n v a l i d / N a m e"));

            // Assert
            Assert.StartsWith("Could not initialize connection to Microsoft Azure Storage: Bad Request", ex.Message);
        }
Exemplo n.º 2
0
        /// <inheritdoc />
        public override async Task <ICollection <WebHook> > GetAllWebHooksAsync(string user)
        {
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            user = NormalizeKey(user);

            CloudTable table = _manager.GetCloudTable(_connectionString, WebHookTable);
            TableQuery query = new TableQuery();

            _manager.AddPartitionKeyConstraint(query, user);

            IEnumerable <DynamicTableEntity> entities = await _manager.ExecuteQueryAsync(table, query);

            ICollection <WebHook> result = entities.Select(e => ConvertToWebHook(e))
                                           .Where(w => w != null)
                                           .ToArray();

            return(result);
        }