[Trait("Category", "integration")] // because it uses external nupkg files public async Task Push2VersionsAndGetPackageVersions() { InitializeClient(MainIndex); var packageResource = await _sourceRepository.GetResourceAsync <PackageUpdateResource>(); await packageResource.Push(TestResources.GetNupkgBagetTwoV1(), null, 5, false, GetApiKey, GetApiKey, false, logger); await packageResource.Push(TestResources.GetNupkgBagetTwoV2(), null, 5, false, GetApiKey, GetApiKey, false, logger); var findByIdRes = new RemoteV3FindPackageByIdResource(_sourceRepository, _httpSource.HttpSource); var versions = await findByIdRes.GetAllVersionsAsync("liget-two", _cacheContext, logger, CancellationToken.None); Assert.Contains(versions, p => p.Equals(NuGetVersion.Parse("1.0.0"))); Assert.Contains(versions, p => p.Equals(NuGetVersion.Parse("2.1.0"))); }
[Trait("Category", "integration")] // because it uses external nupkg files public async Task Push2VersionsThenSearchPackage() { InitializeClient(MainIndex); var packageResource = await _sourceRepository.GetResourceAsync <PackageUpdateResource>(); await packageResource.Push(TestResources.GetNupkgBagetTwoV1(), null, 5, false, GetApiKey, GetApiKey, false, logger); await packageResource.Push(TestResources.GetNupkgBagetTwoV2(), null, 5, false, GetApiKey, GetApiKey, false, logger); PackageSearchResourceV3 search = GetSearch(); var found = await search.SearchAsync("liget-two", new SearchFilter(true), 0, 10, logger, CancellationToken.None); Assert.NotEmpty(found); var ids = found.Select(p => p.Identity); Assert.Contains(ids, p => p.Version.Equals(NuGetVersion.Parse("2.1.0"))); var versions = await found.First().GetVersionsAsync(); Assert.Contains(versions, p => p.Version.Equals(NuGetVersion.Parse("1.0.0"))); Assert.Contains(versions, p => p.Version.Equals(NuGetVersion.Parse("2.1.0"))); }