Exemple #1
0
        internal static void InstallNuGetTemplate(string packageName, ITestOutputHelper log, string homeDirectory, string?workingDirectory = null)
        {
            DotnetNewCommand command = new DotnetNewCommand(log, "-i", packageName)
                                       .WithCustomHive(homeDirectory);

            if (!string.IsNullOrWhiteSpace(workingDirectory))
            {
                command.WithWorkingDirectory(workingDirectory);
            }

            command.Execute()
            .Should()
            .ExitWith(0)
            .And
            .NotHaveStdErr();
        }
Exemple #2
0
        internal static string InstallTestTemplate(string templateName, ITestOutputHelper log, string homeDirectory, string?workingDirectory = null)
        {
            string testTemplate = TestUtils.GetTestTemplateLocation(templateName);

            DotnetNewCommand command = new DotnetNewCommand(log, "-i", testTemplate)
                                       .WithCustomHive(homeDirectory);

            if (!string.IsNullOrWhiteSpace(workingDirectory))
            {
                command.WithWorkingDirectory(workingDirectory);
            }

            command.Execute()
            .Should()
            .ExitWith(0)
            .And
            .NotHaveStdErr();
            return(Path.GetFullPath(testTemplate));
        }