From 3b134c95c0169dca81eb10f16812e31980e0d274 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Fri, 30 Dec 2022 10:09:42 +0100 Subject: [PATCH] Add documentation about necessity of the caller argument expression --- Src/FluentAssertions/Primitives/BooleanAssertions.cs | 1 + docs/_pages/booleans.md | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Src/FluentAssertions/Primitives/BooleanAssertions.cs b/Src/FluentAssertions/Primitives/BooleanAssertions.cs index 3c28e845db..b71e2f1dfb 100644 --- a/Src/FluentAssertions/Primitives/BooleanAssertions.cs +++ b/Src/FluentAssertions/Primitives/BooleanAssertions.cs @@ -123,6 +123,7 @@ public AndConstraint NotBe(bool unexpected, string because = "", pa /// Asserts that the value implies the specified value. /// /// The right hand side for the implication + /// 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! /// /// A formatted phrase as is supported by explaining why the assertion /// is needed. If the phrase does not start with the word because, it is prepended automatically. diff --git a/docs/_pages/booleans.md b/docs/_pages/booleans.md index 501f3aac2c..3e7d483d82 100644 --- a/docs/_pages/booleans.md +++ b/docs/_pages/booleans.md @@ -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! \ No newline at end of file