public NuGetExeClient(TestSettings testSettings, GalleryClient galleryClient) : this(
         testSettings,
         galleryClient,
         LatestVersion,
         SourceType.V3,
         httpCachePath : null,
         globalPackagesPath : null)
 {
 }
 private NuGetExeClient(
     TestSettings testSettings,
     GalleryClient galleryClient,
     string version,
     SourceType sourceType,
     string httpCachePath,
     string globalPackagesPath)
 {
     _version            = version;
     _testSettings       = testSettings;
     _sourceType         = sourceType;
     _httpCachePath      = httpCachePath;
     _globalPackagesPath = globalPackagesPath;
     _galleryClient      = galleryClient;
 }
        /// <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);

            return(new Clients(
                       gallery,
                       v3Index,
                       v2v3Search,
                       flatContainer,
                       registration,
                       nuGetExe));
        }
Exemple #4
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));
        }