Added a Help property to DotnetTestParams that indicates when the parsed arguments included the help param. The TestCommand then uses this property of the params to decide whether to continue with the execution or just return. Also added unit tests around this as well as introduced a DotnetTestRunnerFactory to make these unit tests possible and also push the responsibility to figure out which runner to use to the factory.
This commit is contained in:
parent
47241189b2
commit
d07a1091a8
7 changed files with 143 additions and 7 deletions
|
@ -192,5 +192,20 @@ namespace Microsoft.Dotnet.Tools.Test.Tests
|
|||
{
|
||||
_emptyDotnetTestParams.NoBuild.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void It_sets_Help_to_false_when_help_is_not_passed_in()
|
||||
{
|
||||
_dotnetTestFullParams.Help.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void It_sets_Help_to_true_when_help_is_passed_in()
|
||||
{
|
||||
var dotnetTestParams = new DotnetTestParams();
|
||||
dotnetTestParams.Parse(new[] { "--help" });
|
||||
|
||||
dotnetTestParams.Help.Should().BeTrue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue