diff --git a/src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineOptionsValidator.cs b/src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineOptionsValidator.cs index 9ea02b9a03..87c12cc9b4 100644 --- a/src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineOptionsValidator.cs +++ b/src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineOptionsValidator.cs @@ -167,6 +167,8 @@ private static ValidationResult ValidateOptionsArgumentArity( Dictionary providerAndOptionByOptionName) { StringBuilder stringBuilder = new(); + string commandLine = parseResult.ToCommandLine(); + foreach (IGrouping groupedOptions in parseResult.Options.GroupBy(x => x.Name)) { // getting the arguments count for an option. @@ -181,15 +183,15 @@ private static ValidationResult ValidateOptionsArgumentArity( if (arity > option.Arity.Max && option.Arity.Max == 0) { - stringBuilder.AppendLine(string.Format(CultureInfo.InvariantCulture, PlatformResources.CommandLineOptionExpectsNoArguments, optionName, provider.DisplayName, provider.Uid)); + stringBuilder.AppendLine(string.Format(CultureInfo.InvariantCulture, PlatformResources.CommandLineOptionExpectsNoArguments, optionName, provider.DisplayName, provider.Uid, commandLine)); } else if (arity < option.Arity.Min) { - stringBuilder.AppendLine(string.Format(CultureInfo.InvariantCulture, PlatformResources.CommandLineOptionExpectsAtLeastArguments, optionName, provider.DisplayName, provider.Uid, option.Arity.Min)); + stringBuilder.AppendLine(string.Format(CultureInfo.InvariantCulture, PlatformResources.CommandLineOptionExpectsAtLeastArguments, optionName, provider.DisplayName, provider.Uid, option.Arity.Min, commandLine)); } else if (arity > option.Arity.Max) { - stringBuilder.AppendLine(string.Format(CultureInfo.InvariantCulture, PlatformResources.CommandLineOptionExpectsAtMostArguments, optionName, provider.DisplayName, provider.Uid, option.Arity.Max)); + stringBuilder.AppendLine(string.Format(CultureInfo.InvariantCulture, PlatformResources.CommandLineOptionExpectsAtMostArguments, optionName, provider.DisplayName, provider.Uid, option.Arity.Max, commandLine)); } } diff --git a/src/Platform/Microsoft.Testing.Platform/CommandLine/ParseResult.cs b/src/Platform/Microsoft.Testing.Platform/CommandLine/ParseResult.cs index 1a39282dc7..4f0d33e25d 100644 --- a/src/Platform/Microsoft.Testing.Platform/CommandLine/ParseResult.cs +++ b/src/Platform/Microsoft.Testing.Platform/CommandLine/ParseResult.cs @@ -162,6 +162,47 @@ public override int GetHashCode() return hashCode.ToHashCode(); } + /// + /// Reconstructs the command line from the parsed result. + /// + /// A string representation of the command line. + public string ToCommandLine() + { + var builder = new StringBuilder(); + + if (ToolName is not null) + { + builder.Append(ToolName); + builder.Append(' '); + } + + foreach (CommandLineParseOption option in Options) + { + builder.Append("--"); + builder.Append(option.Name); + + foreach (string arg in option.Arguments) + { + builder.Append(' '); + // Quote arguments that contain spaces + if (arg.Contains(' ')) + { + builder.Append('"'); + builder.Append(arg); + builder.Append('"'); + } + else + { + builder.Append(arg); + } + } + + builder.Append(' '); + } + + return builder.ToString().TrimEnd(); + } + /// public override string ToString() { diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx b/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx index 9ca55934cd..5bac878a06 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx +++ b/src/Platform/Microsoft.Testing.Platform/Resources/PlatformResources.resx @@ -284,13 +284,13 @@ Invalid configuration for provider '{0}' (UID: {1}). Error: {2} - Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments. Command: {4} - Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments. Command: {4} - Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments. Command: {3} Option `--{0}` from provider '{1}' (UID: {2}) is using the reserved prefix '--internal' diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf index 2dd7c37384..f7780601f0 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.cs.xlf @@ -88,17 +88,17 @@ - Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments. Command: {4} Možnost --{0} od zprostředkovatele {1} (UID: {2}) očekává minimálně tento počet argumentů: {3}. - Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments. Command: {4} Možnost --{0} od zprostředkovatele {1} (UID: {2}) očekává maximálně tento počet argumentů: {3}. - Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments. Command: {3} Možnost --{0} od zprostředkovatele {1} (UID: {2}) neočekává žádné argumenty. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf index 2901eea04a..6cdb4daf32 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.de.xlf @@ -88,17 +88,17 @@ - Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments. Command: {4} Die Option "--{0}" vom Anbieter "{1}" (UID: {2}) erwartet mindestens {3} Argumente. - Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments. Command: {4} Die Option "--{0}" vom Anbieter "{1}" (UID: {2}) erwartet höchstens {3} Argumente. - Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments. Command: {3} Die Option "--{0}" vom Anbieter "{1}" (UID: {2}) erwartet keine Argumente. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf index 613ea681c3..0a6bad8489 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.es.xlf @@ -88,17 +88,17 @@ - Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments. Command: {4} La opción “--{0}” del proveedor “{1}” (UID: {2}) espera al menos {3} argumentos - Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments. Command: {4} La opción “--{0}” del proveedor “{1}” (UID: {2}) espera como máximo {3} argumentos - Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments. Command: {3} La opción “--{0}” del proveedor “{1}” (UID: {2}) no espera ningún argumento diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf index 6ac9dfb271..b21817e09c 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.fr.xlf @@ -88,17 +88,17 @@ - Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments. Command: {4}. Command: {4} L’option « --{0} » du fournisseur « {1} » (UID : {2}) attend au moins {3} arguments - Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments. Command: {4}. Command: {4} L’option « --{0} » du fournisseur « {1} » (UID : {2}) attend au plus {3} arguments - Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments. Command: {3}. Command: {3} L’option « --{0} » du fournisseur « {1} » (UID : {2}) n’attend aucun argument diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf index e2b61cae0c..4a13f461b8 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.it.xlf @@ -88,17 +88,17 @@ - Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments. Command: {4} L'opzione '--{0}' del provider '{1}' (UID: {2}) prevede almeno {3} argomenti - Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments. Command: {4} L'opzione '--{0}' del provider '{1}' (UID: {2}% 2) prevede al massimo {3} argomenti - Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments. Command: {3} L'opzione '--{0}' del provider '{1}' (UID: {2}) non prevede argomenti diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf index 1998a73c03..fb1cf5cf1a 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ja.xlf @@ -88,17 +88,17 @@ - Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments. Command: {4} プロバイダー '{1}' (UID:{2}) のオプション '-- {0}' には、少なくとも {3} 引数が必要です - Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments. Command: {4} プロバイダー '{1}' (UID:{2}) のオプション '-- {0}' には、最大 {3} 引数が必要です - Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments. Command: {3} プロバイダー '{1}' のオプション '--{0}' (UID:{2}) には引数が必要ありません diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf index e2d0097ada..950770680a 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ko.xlf @@ -88,17 +88,17 @@ - Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments. Command: {4} 공급자 '{1}'(UID: {2})의 옵션 '--{0}'에는 최소 {3}개의 인수가 필요합니다. - Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments. Command: {4} 공급자 '{1}'(UID: {2})의 옵션 '--{0}'에는 최대 {3}개의 인수가 필요합니다. - Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments. Command: {3} 공급자 '{1}'(UID: {2})의 옵션 '--{0}'에 인수가 필요하지 않습니다. diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf index 9f96ada5b5..ae8f9ee9f9 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pl.xlf @@ -88,17 +88,17 @@ - Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments. Command: {4} Opcja „--{0}” od dostawcy„{1}” (UID: {2}) oczekuje co najmniej {3} argumentów - Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments. Command: {4} Opcja „--{0}” od dostawcy„{1}” (UID: {2}) oczekuje co najwyżej {3} argumentów - Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments. Command: {3} Opcja „--{0}” od dostawcy„{1}” (UID: {2}) nie oczekuje żadnych argumentów diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf index a0884e336d..e20fecf122 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.pt-BR.xlf @@ -88,17 +88,17 @@ - Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments. Command: {4} A opção '--{0}' do provedor '{1}' (UID: {2}) espera pelo menos {3} argumentos - Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments. Command: {4} A opção '--{0}' do provedor '{1}' (UID: {2}) espera no máximo {3} argumentos - Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments. Command: {3} A opção '--{0}' do provedor '{1}' (UID: {2}) não espera argumentos diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf index e57b6d1544..63061a9500 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.ru.xlf @@ -88,17 +88,17 @@ - Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments. Command: {4} Для параметра "--{0}" от поставщика "{1}" (UID: {2}) ожидается не менее {3} аргументов - Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments. Command: {4} Для параметра "--{0}" от поставщика "{1}" (UID: {2}) ожидается не более {3} аргументов - Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments. Command: {3} Для параметра "--{0}" от поставщика "{1}" (UID: {2}) не ожидается никаких аргументов diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf index 4008f64005..07ccc6e028 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.tr.xlf @@ -88,17 +88,17 @@ - Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments. Command: {4} '{1}' sağlayıcısındaki (UID: {2}) '--{0}' seçeneği en az {3} bağımsız değişken bekler - Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments. Command: {4} '{1}' sağlayıcısındaki (UID: {2}) '--{0}' seçeneği en fazla {3} bağımsız değişken bekler - Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments. Command: {3} '{1}' sağlayıcısındaki (UID: {2}) '--{0}' seçeneği hiçbir bağımsız değişken beklemiyor diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf index 5fdcc9180a..211254db7c 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hans.xlf @@ -88,17 +88,17 @@ - Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments. Command: {4} 提供程序“{1}” (UID: {2}) 中的选项“--{0}”应需要至少 {3} 个参数 - Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments. Command: {4} 提供程序“{1}” (UID: {2}) 中的选项“--{0}”应最多需要 {3} 个参数 - Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments. Command: {3} 提供程序“{1}”(UID: {2}) 中的选项“--{0}”不需要任何参数 diff --git a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf index 60fd30786c..ab7075090d 100644 --- a/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf +++ b/src/Platform/Microsoft.Testing.Platform/Resources/xlf/PlatformResources.zh-Hant.xlf @@ -88,17 +88,17 @@ - Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at least {3} arguments. Command: {4} 提供者 '{1}' (UID: {2}) 中的選項 '--{0}' 至少需要 {3} 個引數 - Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects at most {3} arguments. Command: {4} 提供者 '{1}' (UID: {2}) 中的選項 '--{0}' 最多需要 {3} 個引數 - Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments + Option '--{0}' from provider '{1}' (UID: {2}) expects no arguments. Command: {3} 提供者 '{1}' (UID: {2}) 中的選項 '--{0}' 不需要任何引數 diff --git a/test/UnitTests/Microsoft.Testing.Platform.UnitTests/CommandLine/ArgumentArityTests.cs b/test/UnitTests/Microsoft.Testing.Platform.UnitTests/CommandLine/ArgumentArityTests.cs index c688a2062f..b2b1df2b9c 100644 --- a/test/UnitTests/Microsoft.Testing.Platform.UnitTests/CommandLine/ArgumentArityTests.cs +++ b/test/UnitTests/Microsoft.Testing.Platform.UnitTests/CommandLine/ArgumentArityTests.cs @@ -36,7 +36,7 @@ public async Task ParseAndValidate_WhenOptionWithArityZeroIsCalledWithOneArgumen // Assert Assert.IsFalse(result.IsValid); - Assert.AreEqual("Option '--zeroArgumentsOption' from provider 'Microsoft Testing Platform command line provider' (UID: PlatformCommandLineProvider) expects no arguments", result.ErrorMessage, StringComparer.Ordinal); + Assert.AreEqual("Option '--zeroArgumentsOption' from provider 'Microsoft Testing Platform command line provider' (UID: PlatformCommandLineProvider) expects no arguments. Command: --zeroArgumentsOption arg", result.ErrorMessage, StringComparer.Ordinal); } [TestMethod] @@ -52,7 +52,7 @@ public async Task ParseAndValidate_WhenOptionWithArityExactlyOneIsCalledWithTwoA // Assert Assert.IsFalse(result.IsValid); - Assert.AreEqual("Option '--exactlyOneArgumentsOption' from provider 'Microsoft Testing Platform command line provider' (UID: PlatformCommandLineProvider) expects at most 1 arguments", result.ErrorMessage); + Assert.AreEqual("Option '--exactlyOneArgumentsOption' from provider 'Microsoft Testing Platform command line provider' (UID: PlatformCommandLineProvider) expects at most 1 arguments. Command: --exactlyOneArgumentsOption arg1 arg2", result.ErrorMessage); } [TestMethod] @@ -68,7 +68,7 @@ public async Task ParseAndValidate_WhenOptionWithArityExactlyOneIsCalledWithoutA // Assert Assert.IsFalse(result.IsValid); - Assert.AreEqual("Option '--exactlyOneArgumentsOption' from provider 'Microsoft Testing Platform command line provider' (UID: PlatformCommandLineProvider) expects at least 1 arguments", result.ErrorMessage); + Assert.AreEqual("Option '--exactlyOneArgumentsOption' from provider 'Microsoft Testing Platform command line provider' (UID: PlatformCommandLineProvider) expects at least 1 arguments. Command: --exactlyOneArgumentsOption", result.ErrorMessage); } [TestMethod] @@ -84,7 +84,7 @@ public async Task ParseAndValidate_WhenOptionWithArityZeroOrOneIsCalledWithTwoAr // Assert Assert.IsFalse(result.IsValid); - Assert.AreEqual("Option '--zeroOrOneArgumentsOption' from provider 'Microsoft Testing Platform command line provider' (UID: PlatformCommandLineProvider) expects at most 1 arguments", result.ErrorMessage); + Assert.AreEqual("Option '--zeroOrOneArgumentsOption' from provider 'Microsoft Testing Platform command line provider' (UID: PlatformCommandLineProvider) expects at most 1 arguments. Command: --zeroOrOneArgumentsOption arg1 --zeroOrOneArgumentsOption arg2", result.ErrorMessage); } [TestMethod] @@ -100,7 +100,7 @@ public async Task ParseAndValidate_WhenOptionWithArityOneOrMoreIsCalledWithoutAr // Assert Assert.IsFalse(result.IsValid); - Assert.AreEqual("Option '--oneOrMoreArgumentsOption' from provider 'Microsoft Testing Platform command line provider' (UID: PlatformCommandLineProvider) expects at least 1 arguments", result.ErrorMessage); + Assert.AreEqual("Option '--oneOrMoreArgumentsOption' from provider 'Microsoft Testing Platform command line provider' (UID: PlatformCommandLineProvider) expects at least 1 arguments. Command: --oneOrMoreArgumentsOption", result.ErrorMessage); } [TestMethod]