Skip to content

Commit 7d0b72d

Browse files
committed
add test
1 parent 7c87307 commit 7d0b72d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System.CommandLine.IO;
5+
using FluentAssertions;
6+
using Xunit;
7+
8+
namespace System.CommandLine.Tests
9+
{
10+
public class CommandExtensionsTests
11+
{
12+
[Fact]
13+
public void Mulitple_invocations_via_Invoke_extension_will_not_reconfigure_implicit_parser()
14+
{
15+
var command = new RootCommand("Root command description")
16+
{
17+
new Command("inner")
18+
};
19+
20+
var console1 = new TestConsole();
21+
22+
command.Invoke("-h", console1);
23+
24+
console1.Out.ToString().Should().Contain(command.Description);
25+
26+
var console2 = new TestConsole();
27+
28+
command.Invoke("-h", console2);
29+
30+
console2.Out.ToString().Should().Contain(command.Description);
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)