Move PackagedCommands to TestAssets.

Convert package-command-test.ps1 to an XUnit test.
This commit is contained in:
Eric Erhardt 2016-02-10 13:16:23 -06:00
parent b209f98fd1
commit 5d04ca1fe3
15 changed files with 146 additions and 87 deletions

View file

@ -6,7 +6,6 @@ using System;
using System.Diagnostics;
using System.IO;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public class TestCommand
@ -40,11 +39,15 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public virtual CommandResult ExecuteWithCapturedOutput(string args = "")
{
var commandPath = _command;
if (!Path.IsPathRooted(_command))
{
_command = Env.GetCommandPath(_command, ".exe", ".cmd", "") ??
Env.GetCommandPathFromAppBase(AppContext.BaseDirectory, _command, ".exe", ".cmd", "");
}
Console.WriteLine($"Executing (Captured Output) - {_command} {args}");
var commandPath = Env.GetCommandPath(_command, ".exe", ".cmd", "") ??
Env.GetCommandPathFromAppBase(AppContext.BaseDirectory, _command, ".exe", ".cmd", "");
var stdOut = new StreamForwarder();
var stdErr = new StreamForwarder();