Skip to content

Commit

Permalink
Warning xUnit2020 : Do not use Assert.True(false, message) (#869)
Browse files Browse the repository at this point in the history
* Warning xUnit2020 : Do not use Assert.True(false, message)

* Update ReflectionBasedDestructurerTest.cs
  • Loading branch information
SimonCropp authored Oct 19, 2024
1 parent 640111d commit 058123e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public async Task CanDestructureTaskAsync()
try
{
await Task.Delay(1000, cancellationTokenSource.Token);
Assert.True(false, "TaskCanceledException was not thrown.");
Assert.Fail("TaskCanceledException was not thrown.");
return;
}
catch (TaskCanceledException taskCancelledException)
Expand Down Expand Up @@ -438,7 +438,7 @@ private static Exception ThrowAndCatchException(Action throwingAction)
return ex;
}

Assert.True(false, $"{nameof(throwingAction)} did not throw");
Assert.Fail($"{nameof(throwingAction)} did not throw");
return null!; // We should never reach this line.
}

Expand Down

0 comments on commit 058123e

Please sign in to comment.