tests/NuGetGallery.FunctionalTests.Core/Helpers/ClientSdkHelper.cs
/// <summary>
/// Checks if the given package version is present in V2 and V3. This method depends on V2 hijacking to V3.
/// </summary>
Checks if the given package version is present in V2 and V3. This method depends on V2 hijacking to V3.
Checks if the given package version is present in V2 and V3 . This method depends on V2 hijacking to V3 .
private async Task<bool> CheckIfPackageVersionExistsInV2AndV3Async(string packageId, string version)
        {
            var sourceUrl = UrlHelper.V2FeedRootUrl;
            var repo = PackageRepositoryFactory.Default.CreateRepository(sourceUrl);
            NuGet.SemanticVersion semVersion = NuGet.SemanticVersion.Parse(version);
            return await VerifyWithRetryAsync(
                $"Verifying that package {packageId} {version} exists on source {sourceUrl} (hijacked).",
                () =>
                {
                    var package = repo.FindPackage(packageId, semVersion);
                    return Task.FromResult(package != null);
                });
        }
private async Task < bool > CheckIfPackageVersionExistsInV2AndV3Async ( string packageId , string version ) { var sourceUrl = UrlHelper . V2FeedRootUrl ; var repo = PackageRepositoryFactory . Default . CreateRepository ( sourceUrl ) ; NuGet . SemanticVersion semVersion = NuGet . SemanticVersion . Parse ( version ) ; return await VerifyWithRetryAsync ( $" Verifying that package  { packageId } { version }  exists on source  { sourceUrl }  (hijacked). " , ( ) => { var package = repo . FindPackage ( packageId , semVersion ) ; return Task . FromResult ( package != null ) ; } ) ; }
Checks if the given package version is present in V2 and V3.
Checks if the given package version is present in V2 and V3 .
packageId
string
version
string