Skip to content

Commit

Permalink
Add documentation about necessity of the caller argument expression
Browse files Browse the repository at this point in the history
  • Loading branch information
IT-VBFK committed Dec 30, 2022
1 parent 97ccf12 commit 3b134c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Src/FluentAssertions/Primitives/BooleanAssertions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public AndConstraint<TAssertions> NotBe(bool unexpected, string because = "", pa
/// Asserts that the value implies the specified <paramref name="consequent"/> value.
/// </summary>
/// <param name="consequent">The right hand side for the implication</param>
/// <remarks>If you want to use the `because` / `becauseArgs` construct, it is **necessary** to use the caller argument expression, because this would lead to unexpected failure messages, when omitted!</remarks>
/// <param name="because">
/// A formatted phrase as is supported by <see cref="string.Format(string,object[])" /> explaining why the assertion
/// is needed. If the phrase does not start with the word <i>because</i>, it is prepended automatically.
Expand Down
2 changes: 2 additions & 0 deletions docs/_pages/booleans.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ Passing a custom caller argument expression is beneficial for this assertion to
bool anotherBoolean = true;
theBoolean.Should().Imply(anotherBoolean, nameof(anotherBoolean));
```

If you want to use the `because` / `becauseArgs` construct, it is **necessary** to use the caller argument expression, because this would lead to unexpected failure messages, when omitted!

0 comments on commit 3b134c9

Please sign in to comment.