GetPackageIdFromNupkgFile() public method

Given the path to the nupkg file, returns the corresponding package ID.
public GetPackageIdFromNupkgFile ( string filePath ) : string
filePath string
return string
コード例 #1
0
        public async Task DownloadPackageFromV2FeedWithOperation(string packageId, string version, string operation)
        {
            string filename = await DownloadPackageFromFeed(packageId, version, operation);

            // Check if the file exists.
            Assert.True(File.Exists(filename), Constants.PackageDownloadFailureMessage);
            var    clientSdkHelper     = new ClientSdkHelper(TestOutputHelper);
            string downloadedPackageId = clientSdkHelper.GetPackageIdFromNupkgFile(filename);

            // Check that the downloaded Nupkg file is not corrupt and it indeed corresponds to the package which we were trying to download.
            Assert.True(downloadedPackageId.Equals(packageId), Constants.UnableToZipError);
        }
コード例 #2
0
ファイル: ODataHelper.cs プロジェクト: NuGet/NuGetGallery
        public async Task DownloadPackageFromV2FeedWithOperation(string packageId, string version, string operation)
        {
            string filename = await DownloadPackageFromFeed(packageId, version, operation);

            // Check if the file exists.
            Assert.True(File.Exists(filename), Constants.PackageDownloadFailureMessage);
            var clientSdkHelper = new ClientSdkHelper(TestOutputHelper);
            string downloadedPackageId = clientSdkHelper.GetPackageIdFromNupkgFile(filename);
            // Check that the downloaded Nupkg file is not corrupt and it indeed corresponds to the package which we were trying to download.
            Assert.True(downloadedPackageId.Equals(packageId), Constants.UnableToZipError);
        }