Skip to content

Conversation

@jnyrup
Copy link
Member

@jnyrup jnyrup commented Aug 18, 2024

Since developing v7 is a larger undertaking than we initially expected, we want to backport some fixes to v6.

This backporting should cover PRs that were merged since v6.12 and marked as bugs.

🛑 Please do not ask for backporting new features - new features come with new bugs.

IMPORTANT

  • If the PR touches the public API, the changes have been approved in a separate issue with the "api-approved" label.
  • The code complies with the Coding Guidelines for C#.
  • The changes are covered by unit tests which follow the Arrange-Act-Assert syntax and the naming conventions such as is used in these tests.
  • If the PR adds a feature or fixes a bug, please update the release notes with a functional description that explains what the change means to consumers of this library, which are published on the website.
  • If the PR changes the public API the changes needs to be included by running AcceptApiChanges.ps1 or AcceptApiChanges.sh.
  • If the PR affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
    • Please also run ./build.sh --target spellcheck or .\build.ps1 --target spellcheck before pushing and check the good outcome

@github-actions
Copy link

github-actions bot commented Aug 18, 2024

Qodana for .NET

It 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 report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

jnyrup and others added 28 commits August 18, 2024 14:47
…implemented through an explicitly-implemented interface

fixup! BeEquivalentTo will now find and can map subject properties that are implemented through an explicitly-implemented interface
To make it more visible that `GetMethod` is non-null inside `IsExplicitImplementation`
…pectation (fluentassertions#2358)

* Handle non-generic `dictionary` subject when compared with a generic `dictionary` expectation

* Add release notes

Co-authored-by: Jonas Nyrup <jnyrup@users.noreply.github.com>

---------

Co-authored-by: Jonas Nyrup <jnyrup@users.noreply.github.com>
…2329)

* Pass `FormattingOptions` to inner `AssertionScope`

* Add release notes

* Simplify the `AssertionOptions.Formatting` test
* chore: capitalize true and false

Display 'true' and 'false' as capitalized rathen than in lowercase so that both expected value and actual value uses the same casing.
---Before---
"Expected boolean to be false, but found True."
---After---
"Expected boolean to be False, but found True."

* docs: update releases.md
This allows any potential BooleanFormatter to format them
* Add release notes for fluentassertions#2393

* Update releases.md

Co-authored-by: Jonas Nyrup <jnyrup@users.noreply.github.com>

---------

Co-authored-by: Jonas Nyrup <jnyrup@users.noreply.github.com>
…eption is `null` (fluentassertions#2398)

* Improved the failure message for `ThrowExactly[Async]`

* Add release notes

Co-authored-by: Jonas Nyrup <jnyrup@users.noreply.github.com>

---------

Co-authored-by: IT-VBFK <it@voecklabrucker-freikriche.at>
Co-authored-by: Jonas Nyrup <jnyrup@users.noreply.github.com>
…hod)` (fluentassertions#2403)

* Guard against assertion scope: `[Not]HaveExplicitProperty`

* Guard against assertion scope: `[Not]HaveExplicitMethod`

* Add release notes
jnyrup and others added 4 commits August 18, 2024 14:47
For properties and methods `PropertyInfoAssertions` and `MethodBaseAssertions` have assertions to exercise the `private`, `protected` and `private protected` cases in `GetCSharpAccessModifier(MethodBase)`.
We don't have `FieldInfoAssertions` so we only exercise the access modifiers on fields through `WhichGetterHas`/`WhichSetterHas`.
Since `GetFieldsFromHierarchy` excludes `private`, `protected` and `private protected` fields those three cases cannot currently be hit through the public API.
@jnyrup jnyrup marked this pull request as ready for review August 18, 2024 12:48
@jnyrup jnyrup requested a review from dennisdoomen August 18, 2024 14:28
Copy link
Member

@dennisdoomen dennisdoomen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. I do think this PR should address the Qodana issues (if they are genuine).

vbreuss and others added 16 commits August 24, 2024 19:35
…ons#2448)

* Fix "Possible 'null' assignment to non-nullable entity"

* Add null check only when not NET6 or greater
…sertions#2511)

* Fix issue when an empty ArraySegmnet is a member of a class.

With latest, it crashes when trying to access the array members.

* Fix PR comments.

* Fix Qodana complaints

* Update releases.md

* Address review comments

---------

Co-authored-by: Shahar Prish <shaharp@microsoft.com>
…2489)

* Correct null handling when having a nullable struct propertywith a custom comparer.

fluentassertions#2480

* Release notes added

* typo corrected

* Removed the check for only value types and added the null check for the expectation. Also added more tests for all cases.

* typo corrected

* Warnings solved

* Added a comment for the changed code

* Comment cleaned

* Update docs/_pages/releases.md

Co-authored-by: Jonas Nyrup <jnyrup@users.noreply.github.com>

* Typo corrected

Co-authored-by: ITaluone <44049228+ITaluone@users.noreply.github.com>

* Corrected Qodana issues

* cleanups

---------

Co-authored-by: Martin Demberger <martin.demberger@root-nine.de>
Co-authored-by: Jonas Nyrup <jnyrup@users.noreply.github.com>
Co-authored-by: ITaluone <44049228+ITaluone@users.noreply.github.com>
Co-authored-by: Jonas Nyrup <jnyrup@gmail.com>
…entassertions#2530)

* BeEmpty() materializes IEnumerable<T> only once, even on failure

- Make BeEmpty() materialize only the first item, as no further processing is needed for validation
- The error message now mentions "but found at least 1 item" and outputs the said item

* Tweak error message & fix tests

* Make similar changes for BeNullOrEmpty

* Add test, as per request
…assertions#2607)

Also fixed an inconsistency in which one overload of the assertion scope constructor would not actually affect AssertionScope.Current.
The local function avoid allocating a lambda when not used.
For more details, see: dotnet/roslyn#20777
* Create profile.yaml

* Update qodana.yaml

* Update profile.yaml

* Update code_quality.yml

* Update code_quality.yml
@jnyrup jnyrup merged commit a8e7f17 into fluentassertions:master Sep 9, 2024
@IT-VBFK IT-VBFK mentioned this pull request Sep 29, 2024
@jnyrup jnyrup deleted the develop2master branch December 20, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.