Description
Take for example
methodInfo.Should().BeDecoratedWith<DummyMethodAttribute>().Which.Filter.Should().BeFalse();
Even if the call to BeDecoratedWith succeeds and modifies the AssertionChain to report DummyMethodAttribute as the caller identification via the AndWhichConstraint to Which, the next call to Should().BeFalse() will still report methodInfo instead of DummyMethodAttribute.Filter. CallerStatementBuilder simply stops when it encounters the first .Should call.
Reproduction Steps
See test When_a_method_is_decorated_with_an_attribute_it_should_allow_chaining_assertions_on_it
methodInfo.Should().BeDecoratedWith<DummyMethodAttribute>().Which.Filter.Should().BeFalse();
Expected behavior
Expected DummyMethodAttribute.Filter to be False, but found True.
Actual behavior
Expected methodInfo to be False, but found True.
Regression?
No
Known Workarounds
None
Configuration
Fluent Assertions 7.0 with the new AssertionChain
Other information
- Same with
TypeAssertions.BeDecoratedWith and BeDecoratedWithOrInherit
Are you willing to help with a pull-request?
Yes, please assign this issue to me.
Description
Take for example
Even if the call to
BeDecoratedWithsucceeds and modifies theAssertionChainto reportDummyMethodAttributeas the caller identification via theAndWhichConstrainttoWhich, the next call toShould().BeFalse()will still reportmethodInfoinstead ofDummyMethodAttribute.Filter.CallerStatementBuildersimply stops when it encounters the first.Shouldcall.Reproduction Steps
See test
When_a_method_is_decorated_with_an_attribute_it_should_allow_chaining_assertions_on_itExpected behavior
Expected DummyMethodAttribute.Filter to be False, but found True.Actual behavior
Expected methodInfo to be False, but found True.Regression?
No
Known Workarounds
None
Configuration
Fluent Assertions 7.0 with the new
AssertionChainOther information
TypeAssertions.BeDecoratedWithandBeDecoratedWithOrInheritAre you willing to help with a pull-request?
Yes, please assign this issue to me.