예제 #1
0
        private static EventHubScope.AzureResourceProperties CreateStorageAccount()
        {
            var environmentConnectionString = ReadOptionalEnvironmentVariable(TestConstants.StorageConnectionStringEnvironmentVariable);

            if (!string.IsNullOrEmpty(environmentConnectionString))
            {
                return(new EventHubScope.AzureResourceProperties
                       (
                           TestConstants.StorageConnectionStringEnvironmentVariable,
                           environmentConnectionString,
                           shouldRemoveAtCompletion: false
                       ));
            }

            return(Task
                   .Run(async() => await EventHubScope.CreateStorageAsync().ConfigureAwait(false))
                   .ConfigureAwait(false)
                   .GetAwaiter()
                   .GetResult());
        }
 private static EventHubScope.AzureResourceProperties CreateStorageAccount() =>
 Task
 .Run(async() => await EventHubScope.CreateStorageAsync().ConfigureAwait(false))
 .ConfigureAwait(false)
 .GetAwaiter()
 .GetResult();