public void GivenARootWithNonAsciiCharacterInstallSucceeds()
        {
            var nugetConfigPath = GenerateRandomNugetConfigFilePath();

            var    surrogate = char.ConvertFromUtf32(int.Parse("2A601", NumberStyles.HexNumber));
            string nonAscii  = "ab Ṱ̺̺̕o 田中さん åä," + surrogate;

            var root       = _testAssetsManager.CreateTestDirectory(testName: nonAscii, identifier: "root");
            var reporter   = new BufferedReporter();
            var fileSystem = new FileSystemWrapper();
            var store      = new ToolPackageStoreAndQuery(new DirectoryPath(root.Path));

            WriteNugetConfigFileToPointToTheFeed(fileSystem, nugetConfigPath);
            var installer = new ToolPackageInstaller(
                store: store,
                projectRestorer: new Stage2ProjectRestorer(Log, reporter),
                tempProject: GetUniqueTempProjectPathEachTest(),
                offlineFeed: new DirectoryPath("does not exist"));

            var package = installer.InstallPackage(new PackageLocation(nugetConfig: nugetConfigPath),
                                                   packageId: TestPackageId,
                                                   versionRange: VersionRange.Parse(TestPackageVersion),
                                                   targetFramework: _testTargetframework);

            AssertPackageInstall(reporter, fileSystem, package, store, store);

            new ToolPackageUninstaller(store).Uninstall(package.PackageDirectory);
        }
Exemplo n.º 2
0
        public void GivenARootWithNonAsciiCharactorInstallSucceeds()
        {
            var nugetConfigPath = WriteNugetConfigFileToPointToTheFeed();

            var    surrogate = char.ConvertFromUtf32(int.Parse("2A601", NumberStyles.HexNumber));
            string nonAscii  = "ab Ṱ̺̺̕o 田中さん åä," + surrogate;

            var root       = new DirectoryPath(Path.Combine(TempRoot.Root, nonAscii, Path.GetRandomFileName()));
            var reporter   = new BufferedReporter();
            var fileSystem = new FileSystemWrapper();
            var store      = new ToolPackageStore(root);
            var installer  = new ToolPackageInstaller(
                store: store,
                projectRestorer: new ProjectRestorer(reporter),
                tempProject: GetUniqueTempProjectPathEachTest(),
                offlineFeed: new DirectoryPath("does not exist"));

            var package = installer.InstallPackage(new PackageLocation(nugetConfig: nugetConfigPath),
                                                   packageId: TestPackageId,
                                                   versionRange: VersionRange.Parse(TestPackageVersion),
                                                   targetFramework: _testTargetframework);

            AssertPackageInstall(reporter, fileSystem, package, store);

            package.Uninstall();
        }