Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry pick fixes from develop to master #16

Draft
wants to merge 53 commits into
base: master
Choose a base branch
from
Draft

Conversation

jnyrup
Copy link
Owner

@jnyrup jnyrup commented Jul 14, 2024

Cherry-pick fixes from develop to master

Currently excluding fluentassertions#2569

I added these four commits to make it compilable.

I can also make it more digestible by excluding 493f155 and a1b9e7d which I've instead done in #17

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

jnyrup and others added 30 commits July 14, 2024 15:23
…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
dennisdoomen and others added 23 commits July 14, 2024 15:27
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.
…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
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.