/// <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)); }
/// <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)); }
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; }
public V2V3SearchClient(SimpleHttpClient httpClient, V3IndexClient v3IndexClient, TestSettings testSettings) { _httpClient = httpClient; _v3IndexClient = v3IndexClient; _testSettings = testSettings; }
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; }
public GalleryClient(SimpleHttpClient httpClient, TestSettings testSettings) { _httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient)); _testSettings = testSettings ?? throw new ArgumentNullException(nameof(testSettings)); }
public SymbolServerClient(TestSettings testSettings) { _testSettings = testSettings; }
public async Task TestSettingsShouldNotMentionRealApiKeys(string configurationName) { // Arrange Assert.Equal("API_KEY", (await TestSettings.CreateLocalTestConfigurationAsync(configurationName)).ApiKey); }