Added method GetSemiColonEscapedArgs

This commit is contained in:
Harsh Jain 2016-12-30 15:47:15 +05:30
parent 245727183c
commit 19d919a640
2 changed files with 23 additions and 3 deletions

View file

@ -253,7 +253,6 @@ namespace Microsoft.DotNet.Tools.Test
private static string[] GetRunSettingsOptions(List<string> remainingArgs)
{
int counter = 0;
List<string> runsettingsArgs = new List<string>();
List<string> argsToRemove = new List<string>();
@ -280,5 +279,26 @@ namespace Microsoft.DotNet.Tools.Test
return string.IsNullOrEmpty(arg) ? arg : arg.Replace(";", "%3b");
}
private static string[] GetSemiColonEscapedArgs(List<string> args)
{
int counter = 0;
string[] array = new string[args.Count];
foreach (string arg in args)
{
if (arg.IndexOf(";") != -1)
{
array[counter] = arg.Replace(";", "%3b");
}
else
{
array[counter] = arg;
}
counter++;
}
return array;
}
}
}

View file

@ -170,7 +170,7 @@ namespace Microsoft.DotNet.Cli.Test.Tests
.ExecuteWithCapturedOutput("--logger \"trx;logfilename=custom.trx\" -- RunConfiguration.ResultsDirectory=" + trxLoggerDirectory);
// Verify
String[] trxFiles = Directory.GetFiles(trxLoggerDirectory, "*.trx");
String[] trxFiles = Directory.GetFiles(trxLoggerDirectory, "custom.trx");
Assert.Equal(1, trxFiles.Length);
result.StdOut.Should().Contain(trxFiles[0]);