Skip to content

Commit 567ca0a

Browse files
Improve assertion for flaky test (#17796)
Improve assertion for flaky test
1 parent ee25c64 commit 567ca0a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Bicep.Cli.UnitTests/Assertions/CliResultAssertions.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ public AndConstraint<CliResultAssertions> HaveStdoutMatch(string stdout, string
4949
}
5050

5151
public AndConstraint<CliResultAssertions> NotHaveStdout(string because = "", params object[] becauseArgs)
52-
=> HaveStdout("", because, becauseArgs);
52+
{
53+
Subject.Stdout.Should().BeEmpty(because, becauseArgs);
54+
55+
return new(this);
56+
}
5357

5458
public AndConstraint<CliResultAssertions> HaveStderr(string stderr, string because = "", params object[] becauseArgs)
5559
{
@@ -73,7 +77,11 @@ public AndConstraint<CliResultAssertions> NotHaveStderrMatch(string stderr, stri
7377
}
7478

7579
public AndConstraint<CliResultAssertions> NotHaveStderr(string because = "", params object[] becauseArgs)
76-
=> HaveStderr("", because, becauseArgs);
80+
{
81+
Subject.Stderr.Should().BeEmpty(because, becauseArgs);
82+
83+
return new(this);
84+
}
7785

7886
public AndConstraint<CliResultAssertions> HaveCompileError(string? errorCode = null, string because = "", params object[] becauseArgs)
7987
{

0 commit comments

Comments
 (0)