Respond to PR feedback in moving the UseVSTestRunner into the test DBPs file and removing the unnecessary $ in the command result assertion file

This commit is contained in:
Marc Paine 2024-07-03 15:22:39 -07:00
parent 68acf81475
commit cc62208676
3 changed files with 7 additions and 8 deletions

View file

@ -31,8 +31,6 @@
This is a prevalent problem in building the precomputed assembly reference cache. Limiting the assemblies resolved
to those outside the culture folders would work, but that is a nontrivial problem. -->
<NoWarn>NU5125;NU5105;NU1701;MSB3243;MSB3247</NoWarn>
<UseVSTestRunner>true</UseVSTestRunner>
</PropertyGroup>
<PropertyGroup Condition="'$(DisableSourceLink)' == 'true'">

View file

@ -3,5 +3,6 @@
<Import Project="..\eng\TestVersions.props" />
<PropertyGroup>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
<UseVSTestRunner>true</UseVSTestRunner>
</PropertyGroup>
</Project>

View file

@ -28,21 +28,21 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public AndConstraint<CommandResultAssertions> Pass()
{
Execute.Assertion.ForCondition(_commandResult.ExitCode == 0)
.FailWith(AppendDiagnosticsTo($"Expected command to pass but it did not."));
.FailWith(AppendDiagnosticsTo("Expected command to pass but it did not."));
return new AndConstraint<CommandResultAssertions>(this);
}
public AndConstraint<CommandResultAssertions> Fail()
{
Execute.Assertion.ForCondition(_commandResult.ExitCode != 0)
.FailWith(AppendDiagnosticsTo($"Expected command to fail but it did not."));
.FailWith(AppendDiagnosticsTo("Expected command to fail but it did not."));
return new AndConstraint<CommandResultAssertions>(this);
}
public AndConstraint<CommandResultAssertions> HaveStdOut()
{
Execute.Assertion.ForCondition(!string.IsNullOrEmpty(_commandResult.StdOut))
.FailWith(AppendDiagnosticsTo($"Command did not output anything to stdout"));
.FailWith(AppendDiagnosticsTo("Command did not output anything to stdout"));
return new AndConstraint<CommandResultAssertions>(this);
}
@ -97,7 +97,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public AndConstraint<CommandResultAssertions> HaveStdErr()
{
Execute.Assertion.ForCondition(!string.IsNullOrEmpty(_commandResult.StdErr))
.FailWith(AppendDiagnosticsTo($"Command did not output anything to stderr."));
.FailWith(AppendDiagnosticsTo("Command did not output anything to stderr."));
return new AndConstraint<CommandResultAssertions>(this);
}
@ -125,14 +125,14 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public AndConstraint<CommandResultAssertions> NotHaveStdOut()
{
Execute.Assertion.ForCondition(string.IsNullOrEmpty(_commandResult.StdOut))
.FailWith(AppendDiagnosticsTo($"Expected command to not output to stdout but it was not:"));
.FailWith(AppendDiagnosticsTo("Expected command to not output to stdout but it was not:"));
return new AndConstraint<CommandResultAssertions>(this);
}
public AndConstraint<CommandResultAssertions> NotHaveStdErr()
{
Execute.Assertion.ForCondition(string.IsNullOrEmpty(_commandResult.StdErr))
.FailWith(AppendDiagnosticsTo($"Expected command to not output to stderr but it was not:"));
.FailWith(AppendDiagnosticsTo("Expected command to not output to stderr but it was not:"));
return new AndConstraint<CommandResultAssertions>(this);
}