public ServiceIndexClientTests() { var httpClient = new HttpClient(new HttpClientHandler { AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate }); _target = new ServiceIndexClient(httpClient, "https://api.nuget.org/v3/index.json"); _Url = new Lazy <Task <UrlGeneratorClient> >(() => UrlGeneratorClient.CreateAsync(_target)); }
private static async Task <Uri> GetCatalogIndexUrlAsync(HttpClient httpClient, string sourceUrl) { var client = new ServiceIndexClient(httpClient); var serviceIndex = await client.GetServiceIndexAsync(sourceUrl); var resource = serviceIndex.Resources.First(r => r.Type == "Catalog/3.0.0"); return(new Uri(resource.Url)); }
public PackageContentTests() { var httpClient = new HttpClient(new HttpClientHandler { AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate }); var serviceIndex = new ServiceIndexClient(httpClient, "https://api.nuget.org/v3/index.json"); var urlGeneratorFactory = new UrlGeneratorClientFactory(serviceIndex); _target = new PackageContentClient(urlGeneratorFactory, httpClient); }
public ProtocolFixture() { var httpClient = new HttpClient(new HttpClientHandler { AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate, }); ServiceIndexClient = new ServiceIndexClient(httpClient, "https://api.nuget.org/v3/index.json"); ContentClient = new PackageContentClient(httpClient, "https://api.nuget.org/v3-flatcontainer"); MetadataClient = new PackageMetadataClient(httpClient, "https://api.nuget.org/v3/registration3-gz-semver2"); SearchClient = new SearchClient( httpClient, "https://azuresearch-usnc.nuget.org/query", "https://azuresearch-ussc.nuget.org/autocomplete"); }
public PackageMetadataServiceIntegrationTests() { var httpClient = new HttpClient(); var serviceIndexClient = new ServiceIndexClient(httpClient); var registrationClient = new RegistrationClient(httpClient); var packageContentClient = new PackageContentClient(httpClient); var serviceIndex = "https://api.nuget.org/v3/index.json"; var serviceIndexService = new ServiceIndexService(serviceIndex, serviceIndexClient); _target = new PackageMetadataService( serviceIndexService, registrationClient, packageContentClient); }
public ProtocolFixture() { var httpClient = new HttpClient(new TestDataHttpMessageHandler()); NuGetClientFactory = new NuGetClientFactory(httpClient, TestData.ServiceIndexUrl); NuGetClient = new NuGetClient(NuGetClientFactory); ServiceIndexClient = new ServiceIndexClient(httpClient, TestData.ServiceIndexUrl); ContentClient = new RawPackageContentClient(httpClient, TestData.PackageContentUrl); MetadataClient = new RawPackageMetadataClient(httpClient, TestData.PackageMetadataUrl); CatalogClient = new RawCatalogClient(httpClient, TestData.CatalogIndexUrl); SearchClient = new RawSearchClient( httpClient, TestData.SearchUrl, TestData.AutocompleteUrl); }
public PackageMetadataServiceIntegrationTests() { var httpClient = new HttpClient(new HttpClientHandler { AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate, }); var serviceIndexClient = new ServiceIndexClient(httpClient); var registrationClient = new RegistrationClient(httpClient); var packageContentClient = new PackageContentClient(httpClient); var serviceIndex = "https://api.nuget.org/v3/index.json"; var serviceIndexService = new ServiceIndexService(serviceIndex, serviceIndexClient); _target = new PackageMetadataService( serviceIndexService, registrationClient, packageContentClient); }
public ServiceIndexClientTests(ProtocolFixture fixture) { _target = fixture.ServiceIndexClient; }
public ServiceIndexClientTests() { var httpClient = new HttpClient(); _target = new ServiceIndexClient(httpClient); }