Skip to content

Commit c954724

Browse files
authored
Fixes displaying arity for many (N instead of int.Max) (#3115)
1 parent 668ec32 commit c954724

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineHandler.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ async Task DisplayOptionsAsync(IEnumerable<CommandLineOption> options, int inden
144144
}
145145
else
146146
{
147-
await _platformOutputDevice.DisplayAsync(this, new TextOutputDeviceData($"{optionInfoIndent}Arity: {option.Arity.Min}..{option.Arity.Max}"));
147+
string maxArityValue = option.Arity.Max == int.MaxValue ? "N" : $"{option.Arity.Max}";
148+
await _platformOutputDevice.DisplayAsync(this, new TextOutputDeviceData($"{optionInfoIndent}Arity: {option.Arity.Min}..{maxArityValue}"));
148149
}
149150

150151
await _platformOutputDevice.DisplayAsync(this, new TextOutputDeviceData($"{optionInfoIndent}Hidden: {option.IsHidden}"));

test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/InfoTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public async Task Info_WhenMSTestExtensionRegistered_OutputInfoContentOfRegister
163163
Hidden: False
164164
Description: Filters tests using the given expression\. For more information, see the Filter option details section\. For more information and examples on how to use selective unit test filtering, see https://learn\.microsoft\.com/dotnet/core/testing/selective-unit-tests\.
165165
--test-parameter
166-
Arity: 1\.\.2147483647
166+
Arity: 1\.\.N
167167
Hidden: False
168168
Description: Specify or override a key-value pair parameter\. For more information and examples, see https://learn\.microsoft\.com/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file#testrunparameters
169169
Registered tools:

0 commit comments

Comments
 (0)