Пример #1
0
        public async Task ExecuteQuery_ReturnsEmptyCollection_IfNotFoundRowKey()
        {
            // Arrange
            CloudTable table = InitializeTable();

            await CreateTableRows(table);

            TableQuery query = new TableQuery {
                FilterString = "PartitionKey eq 'Unknown'"
            };

            // Act
            IEnumerable <DynamicTableEntity> actual = await _manager.ExecuteQueryAsync(table, query);

            // Assert
            Assert.Empty(actual);
        }
Пример #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);
        }