public async Task TestFolderNuGetProjectDeletePackage()
        {
            // Arrange
            var packageIdentity = new PackageIdentity("packageA", new NuGetVersion("1.0.0"));
            var randomTestSourcePath = TestFilesystemUtility.CreateRandomTestFolder();
            var packageFileInfo = TestPackages.GetLegacyContentPackage(randomTestSourcePath, packageIdentity.Id, packageIdentity.Version.ToNormalizedString());
            var randomTestDestinationPath = TestFilesystemUtility.CreateRandomTestFolder();
            var folderNuGetProject = new FolderNuGetProject(randomTestDestinationPath);
            var packagePathResolver = new PackagePathResolver(randomTestDestinationPath);
            var packageInstallPath = packagePathResolver.GetInstallPath(packageIdentity);
            var nupkgFilePath = Path.Combine(packageInstallPath, packagePathResolver.GetPackageFileName(packageIdentity));
            var testNuGetProjectContext = new TestNuGetProjectContext();
            var token = CancellationToken.None;
            using (var packageStream = packageFileInfo.OpenRead())
            {
                // Act
                await folderNuGetProject.InstallPackageAsync(packageIdentity, packageStream, testNuGetProjectContext, token);
            }

            var unNormalizedPackageIdentity = new PackageIdentity(packageIdentity.Id,
                new NuGetVersion(packageIdentity.Version + ".0"));

            // Assert
            Assert.True(File.Exists(nupkgFilePath));
            Assert.True(File.Exists(Path.Combine(packageInstallPath, "Content/Scripts/test1.js")));
            using (var packageStream = File.OpenRead(nupkgFilePath))
            {
                var zipArchive = new ZipArchive(packageStream);
                Assert.Equal(6, zipArchive.Entries.Count);
            }
            Assert.True(folderNuGetProject.PackageExists(packageIdentity));
            var packageDirectoryPath = folderNuGetProject.GetInstalledPath(unNormalizedPackageIdentity);
            Assert.True(!String.IsNullOrEmpty(packageDirectoryPath));
            Assert.True(Directory.Exists(packageDirectoryPath));

            // Main Act
            await folderNuGetProject.DeletePackage(packageIdentity, testNuGetProjectContext, CancellationToken.None);

            // Assert
            Assert.False(folderNuGetProject.PackageExists(unNormalizedPackageIdentity));
            // Check that the package directories are deleted
            Assert.False(Directory.Exists(packageDirectoryPath));

            // Clean-up
            TestFilesystemUtility.DeleteRandomTestFolders(randomTestSourcePath, randomTestDestinationPath);
        }
        public async Task TestFolderNuGetProjectPackageExists()
        {
            // Arrange
            var packageIdentity = new PackageIdentity("packageA", new NuGetVersion("1.0.0"));
            var randomTestSourcePath = TestFilesystemUtility.CreateRandomTestFolder();
            var packageFileInfo = TestPackages.GetLegacyTestPackage(randomTestSourcePath, packageIdentity.Id, packageIdentity.Version.ToNormalizedString());
            var randomTestDestinationPath = TestFilesystemUtility.CreateRandomTestFolder();
            var folderNuGetProject = new FolderNuGetProject(randomTestDestinationPath);
            var packagePathResolver = new PackagePathResolver(randomTestDestinationPath);
            var packageInstallPath = packagePathResolver.GetInstallPath(packageIdentity);
            var nupkgFilePath = Path.Combine(packageInstallPath, packagePathResolver.GetPackageFileName(packageIdentity));
            var testNuGetProjectContext = new TestNuGetProjectContext();
            var token = CancellationToken.None;
            using (var packageStream = packageFileInfo.OpenRead())
            {
                // Act
                await folderNuGetProject.InstallPackageAsync(packageIdentity, packageStream, testNuGetProjectContext, token);
            }

            // Assert
            Assert.True(File.Exists(nupkgFilePath));
            Assert.True(File.Exists(Path.Combine(packageInstallPath, "lib/test.dll")));
            using (var packageStream = File.OpenRead(nupkgFilePath))
            {
                var zipArchive = new ZipArchive(packageStream);
                Assert.Equal(5, zipArchive.Entries.Count);
            }

            // Main Act
            var packageExists = folderNuGetProject.PackageExists(new PackageIdentity(packageIdentity.Id,
                new NuGetVersion(packageIdentity.Version + ".0")));

            // Assert
            Assert.True(packageExists);

            // Clean-up
            TestFilesystemUtility.DeleteRandomTestFolders(randomTestSourcePath, randomTestDestinationPath);
        }