public async Task Test_ExtractionIgnoresNupkgHashFile() { // Arrange var packageIdentity = new PackageIdentity("packageA", new NuGetVersion("2.0.3")); using (var packagesDirectory = TestDirectory.Create()) { var pathResolver = new VersionFolderPathResolver(packagesDirectory); var packageFileInfo = await TestPackagesCore.GetPackageWithSHA512AtRoot( packagesDirectory, packageIdentity.Id, packageIdentity.Version.ToNormalizedString()); var packageExtractionContext = new PackageExtractionContext( packageSaveMode: PackageSaveMode.Defaultv3, xmlDocFileSaveMode: XmlDocFileSaveMode.None, logger: NullLogger.Instance, signedPackageVerifier: null, signedPackageVerifierSettings: null); var versionFolderPathResolver = new VersionFolderPathResolver(packagesDirectory); // Act using (var packageDownloader = new LocalPackageArchiveDownloader( null, packageFileInfo.FullName, packageIdentity, NullLogger.Instance)) { await PackageExtractor.InstallFromSourceAsync( packageIdentity, packageDownloader, versionFolderPathResolver, packageExtractionContext, CancellationToken.None); } // Assert var packageVersionDirectory = pathResolver.GetInstallPath(packageIdentity.Id, packageIdentity.Version); AssertDirectoryExists(packageVersionDirectory); AssertFileExists(packageVersionDirectory, pathResolver.GetPackageFilePath(packageIdentity.Id, packageIdentity.Version)); AssertFileExists(packageVersionDirectory, pathResolver.GetManifestFileName(packageIdentity.Id, packageIdentity.Version)); AssertFileExists(packageVersionDirectory, "lib", "net45", "A.dll"); var hashPath = pathResolver.GetHashPath(packageIdentity.Id, packageIdentity.Version); var hashFileInfo = new FileInfo(hashPath); Assert.True(File.Exists(hashFileInfo.FullName)); Assert.NotEqual(0, hashFileInfo.Length); var bsha512Path = Path.Combine(packageVersionDirectory, "lib", "net45", "B.sha512"); var bsha512FileInfo = new FileInfo(bsha512Path); Assert.True(File.Exists(bsha512FileInfo.FullName)); Assert.Equal(0, bsha512FileInfo.Length); var csha512Path = Path.Combine(packageVersionDirectory, "C.sha512"); var csha512FileInfo = new FileInfo(csha512Path); Assert.True(File.Exists(csha512FileInfo.FullName)); Assert.Equal(0, csha512FileInfo.Length); } }