public async Task ExecuteRetrieval_ReturnsNotFound_IfInvalidTable()
        {
            // Arrange
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true;");
            CloudTableClient    client         = storageAccount.CreateCloudTableClient();
            CloudTable          table          = client.GetTableReference("unknown");

            // Act
            TableResult actual = await _manager.ExecuteRetrievalAsync(table, TestPartition, "data");

            // Assert
            Assert.Equal(404, actual.HttpStatusCode);
        }
Beispiel #2
0
        /// <inheritdoc />
        public async Task <WebHook> LookupWebHookAsync(string user, string id)
        {
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }

            user = NormalizeKey(user);
            id   = NormalizeKey(id);

            CloudTable  table  = _manager.GetCloudTable(_connectionString, WebHookTable);
            TableResult result = await _manager.ExecuteRetrievalAsync(table, user, id);

            if (!result.IsSuccess())
            {
                string msg = string.Format(CultureInfo.CurrentCulture, AzureStorageResources.AzureStore_NotFound, user, id);
                _logger.Info(msg);
                return(null);
            }

            DynamicTableEntity entity = result.Result as DynamicTableEntity;

            return(ConvertToWebHook(entity));
        }