{{ message }}
Introduced a new attribute to allow global initialization of the assertion options#2292
Merged
dennisdoomen merged 2 commits intoOct 26, 2023
Conversation
40173e5 to
6192a96
Compare
This comment was marked as outdated.
This comment was marked as outdated.
0e24df3 to
1e9b078
Compare
1e9b078 to
7dc23f8
Compare
7dc23f8 to
3e0e13d
Compare
Corniel
reviewed
Sep 19, 2023
Corniel
left a comment
Contributor
There was a problem hiding this comment.
Overall, it looks good. I think explaining what the effect is of 'using multiple times', v.s. 'called once' might be explained in more detail.
Member
Author
3e0e13d to
b5a3c2c
Compare
jnyrup
reviewed
Sep 23, 2023
51f8e09 to
e533255
Compare
Qodana for .NETIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2023.2.8
with:
upload-result: trueContact Qodana teamContact us at qodana-support@jetbrains.com
|
Pull Request Test Coverage Report for Build 6652964260
💛 - Coveralls |
jnyrup
reviewed
Oct 15, 2023
jnyrup
approved these changes
Oct 15, 2023
bc727d5 to
c4aec36
Compare
This was referenced Jun 18, 2026
Closed
This was referenced Jun 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR introduces FA's own "module initializer" through the new
[AssertionEngineInitializer]attribute. It can be used multiple times.For future reference, we're not using
ModuleInitializerAttributefor two reasons:FluentAssertions.DataSetsmay not even get a chance to register its custom implementations ofIEquivalencyStepwhen somebody invokesBeEquivalentTowithout explicitly using code from that package first. To resolve this, you could have that package add a source file as content (in NuGet terms) that adds a module initializer. Then it would be invoked the first time the test project is loaded. But that would require that source file to define theModuleInitializerAttributefor .NET 4.x, which is hard since you can't detect whether it is needed. non-SDK projects do not define attributes like NETFRAMEWORK and such. If that test project already defines that attribute in a different way (e.g. using Polysharp), it would cause compilation conflicts.Also, while testing with
FluentAssertions.DataSets, it turns out the caller identifier was misbehaving if Fluent Assertions code preceded the data set extensions code in the stack trace. This has been fixed as well.Tested with the FluentAssertions.DataSets repository.
Note Review by commit
Closes #2290