We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cf6130 commit 9bc8e71Copy full SHA for 9bc8e71
src/System.CommandLine.Tests/ArgumentTests.cs
@@ -443,6 +443,24 @@ public void When_argument_cannot_be_parsed_as_the_specified_type_then_getting_va
443
.Be("'not-an-int' is not an integer");
444
}
445
446
+ [Fact]
447
+ public void Parse_delegate_is_called_once_per_parse_operation()
448
+ {
449
+ var i = 0;
450
+
451
+ var command = new RootCommand
452
453
+ new Option<int>(
454
+ "-x",
455
+ result => ++i,
456
+ isDefault: true)
457
+ };
458
459
+ command.Parse("");
460
461
462
+ i.Should().Be(2);
463
+ }
464
465
466
protected override Symbol CreateSymbol(string name)
0 commit comments