Пример #1
0
        /// <summary>
        /// In lieu of proper dependency injection, initialize dependencies manually.
        /// </summary>
        private static Clients InitializeInternal(TestSettings testSettings)
        {
            var azureManagementAPI = GetAzureManagementAPIWrapper(testSettings);

            var httpClient         = new SimpleHttpClient();
            var gallery            = new GalleryClient(httpClient, testSettings, azureManagementAPI);
            var v3Index            = new V3IndexClient(httpClient, testSettings);
            var v2v3Search         = new V2V3SearchClient(httpClient, v3Index, testSettings, azureManagementAPI);
            var flatContainer      = new FlatContainerClient(httpClient, v3Index);
            var registration       = new RegistrationClient(httpClient, v3Index);
            var nuGetExe           = new NuGetExeClient(testSettings, gallery);
            var symbolServerClient = new SymbolServerClient(testSettings);

            return(new Clients(
                       gallery,
                       v3Index,
                       v2v3Search,
                       flatContainer,
                       registration,
                       nuGetExe,
                       symbolServerClient));
        }
Пример #2
0
        /// <summary>
        /// In lieu of proper dependency injection, initialize dependencies manually.
        /// </summary>
        private static Clients InitializeInternal(TestSettings testSettings)
        {
            // Ensure that SSLv3 is disabled and that Tls v1.2 is enabled.
            ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Ssl3;
            ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;

            var httpClient         = new SimpleHttpClient();
            var gallery            = new GalleryClient(httpClient, testSettings);
            var v3Index            = new V3IndexClient(httpClient, testSettings);
            var v2v3Search         = new V2V3SearchClient(httpClient, v3Index, testSettings);
            var flatContainer      = new FlatContainerClient(httpClient, v3Index);
            var registration       = new RegistrationClient(httpClient, v3Index);
            var nuGetExe           = new NuGetExeClient(testSettings, gallery);
            var symbolServerClient = new SymbolServerClient(testSettings);

            return(new Clients(
                       gallery,
                       v3Index,
                       v2v3Search,
                       flatContainer,
                       registration,
                       nuGetExe,
                       symbolServerClient));
        }
Пример #3
0
        public virtual async Task InitializeAsync()
        {
            TestSettings = await TestSettings.CreateAsync();

            Clients = Clients.Initialize(TestSettings);
        }
 public GalleryClient(SimpleHttpClient httpClient, TestSettings testSettings, IRetryingAzureManagementAPIWrapper azureManagementAPIWrapper)
 {
     _httpClient   = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
     _testSettings = testSettings ?? throw new ArgumentNullException(nameof(testSettings));
     _azureManagementAPIWrapper = azureManagementAPIWrapper;
 }
 public V3IndexClient(SimpleHttpClient httpClient, TestSettings testSettings)
 {
     _httpClient   = httpClient;
     _testSettings = testSettings;
 }
Пример #6
0
 public V2V3SearchClient(SimpleHttpClient httpClient, V3IndexClient v3IndexClient, TestSettings testSettings)
 {
     _httpClient    = httpClient;
     _v3IndexClient = v3IndexClient;
     _testSettings  = testSettings;
 }
Пример #7
0
        private static IRetryingAzureManagementAPIWrapper GetAzureManagementAPIWrapper(TestSettings testSettings)
        {
            if (testSettings.AzureManagementAPIWrapperConfiguration != null)
            {
                return(new RetryingAzureManagementAPIWrapper(
                           new AzureManagementAPIWrapper(testSettings.AzureManagementAPIWrapperConfiguration),
                           RetryUtility.DefaultSleepDuration));
            }

            return(null);
        }
 public async Task InitializeAsync()
 {
     TestSettings = await TestSettings.CreateAsync();
 }
 public V2V3SearchClient(SimpleHttpClient httpClient, V3IndexClient v3IndexClient, TestSettings testSettings, IRetryingAzureManagementAPIWrapper azureManagementAPIWrapper)
 {
     _httpClient                = httpClient;
     _v3IndexClient             = v3IndexClient;
     _testSettings              = testSettings;
     _azureManagementAPIWrapper = azureManagementAPIWrapper;
 }
Пример #10
0
 public GalleryClient(SimpleHttpClient httpClient, TestSettings testSettings)
 {
     _httpClient   = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
     _testSettings = testSettings ?? throw new ArgumentNullException(nameof(testSettings));
 }
Пример #11
0
 public SymbolServerClient(TestSettings testSettings)
 {
     _testSettings = testSettings;
 }
Пример #12
0
 public async Task TestSettingsShouldNotMentionRealApiKeys(string configurationName)
 {
     // Arrange
     Assert.Equal("API_KEY", (await TestSettings.CreateLocalTestConfigurationAsync(configurationName)).ApiKey);
 }