Ejemplo n.º 1
0
        private static void SetupStaticTestProject()
        {
            AssetsRoot = Path.Combine(AppContext.BaseDirectory, "bin");
            RestoredTestProjectDirectory = Path.Combine(AssetsRoot, s_testdirName);

            // Ignore Delete Failure
            try
            {
                Directory.Delete(RestoredTestProjectDirectory, true);
            }
            catch (Exception) { }

            Directory.CreateDirectory(RestoredTestProjectDirectory);

            // Todo: this is a hack until corefx is on nuget.org remove this After RC 2 Release
            NuGetConfig.Write(RestoredTestProjectDirectory);

            var newCommand = new NewCommand();
            newCommand.WorkingDirectory = RestoredTestProjectDirectory;
            newCommand.Execute().Should().Pass();

            var restoreCommand = new RestoreCommand();
            restoreCommand.WorkingDirectory = RestoredTestProjectDirectory;
            restoreCommand.Execute().Should().Pass();
        }
        public void CreateWithEphemeralHiveAndNoRestore(
            string templateName,
            string outputDirectory,
            string workingDirectory)
        {
            var result = new NewCommand()
                         .WithWorkingDirectory(workingDirectory)
                         .Execute($"{templateName} -o {outputDirectory} --debug:ephemeral-hive");

            if (result.ExitCode != 0)
            {
                throw new InvalidOperationException(result.StdErr);
            }
        }