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

Add support for Satisfy on ReferenceTypeAssertions #2597

Merged
merged 15 commits into from
Jun 10, 2024

Conversation

siewers
Copy link
Contributor

@siewers siewers commented Feb 29, 2024

Added support for Satisfy on ReferenceTypeAssertions allowing to use element inspectors as an alternative to using predicates on Match.

Example:

var myDto = new Dto { Name = "Some Name" };

myDto.Should().Satisfy<Dto>(dto => dto.Name.Should().Be("Some Name"));

Fixed #2516

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

Copy link

github-actions bot commented Feb 29, 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 [email protected]

@ITaluone
Copy link
Contributor

ITaluone commented Mar 1, 2024

Missing release notes?

@siewers
Copy link
Contributor Author

siewers commented Mar 1, 2024

I didn't add it to the release notes yet as I'm unsure what version this will be in.

@dennisdoomen I can see that we're at Alpha 3 now, but the release notes only contain Alpha 1. I've added the changes to the current section of the releases.md, but I think something might be wrong. Can you let me know if I need to change something?

@ITaluone
Copy link
Contributor

ITaluone commented Mar 1, 2024

I didn't add it to the release notes yet as I'm unsure what version this will be in.

I think while on develop for the next version it doesn't really matter

@siewers
Copy link
Contributor Author

siewers commented Mar 1, 2024

@ITaluone Alright, I added it the the most recent section. I guess it will be aligned when the final release goes out, however, it might be a bit confusing for people using the Alpha versions to see the release notes not reflecting the latest version.

@siewers
Copy link
Contributor Author

siewers commented Mar 1, 2024

@dennisdoomen @ITaluone I believe I've addressed all comments now.

Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs Outdated Show resolved Hide resolved
Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs Outdated Show resolved Hide resolved
Src/FluentAssertions/Primitives/ReferenceTypeAssertions.cs Outdated Show resolved Hide resolved
docs/_pages/basicassertions.md Show resolved Hide resolved
docs/_pages/releases.md Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Mar 11, 2024

Pull Request Test Coverage Report for Build 9436657769

Details

  • 22 of 22 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 97.577%

Totals Coverage Status
Change from base Build 9428450907: 0.01%
Covered Lines: 12078
Relevant Lines: 12261

💛 - Coveralls

@dennisdoomen
Copy link
Member

I believe I've addressed all comments now.

Apparently not.

@ITaluone
Copy link
Contributor

@siewers Could you rebase to current develop and force push again?

@siewers siewers force-pushed the develop branch 2 times, most recently from 84bfdf1 to a7be412 Compare March 12, 2024 13:44
@siewers siewers closed this Mar 17, 2024
@dennisdoomen
Copy link
Member

Did you close it on purpose?

@siewers
Copy link
Contributor Author

siewers commented Mar 17, 2024

Wow, no, I didn't... I don't know what happened.

@siewers siewers reopened this Mar 17, 2024
@siewers
Copy link
Contributor Author

siewers commented May 12, 2024

@dennisdoomen I see you approved this PR, but it's blocked by a couple of checks. Is there anything further on my part I need to take care of?

@IT-VBFK
Copy link
Contributor

IT-VBFK commented May 12, 2024

Rebase to current develop and force push

Copy link

github-actions bot commented May 14, 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 [email protected]

@ITaluone
Copy link
Contributor

@siewers To fix the current problems rebase again :)

@siewers
Copy link
Contributor Author

siewers commented May 23, 2024

I've rebased, and all checks are passing. Can we merge this?

@dennisdoomen
Copy link
Member

I've rebased, and all checks are passing. Can we merge this?

Waiting for a review from @jnyrup

@jnyrup jnyrup changed the title Add support for Satisfy on ReferenceTypeAssertions Add support for Satisfy on ReferenceTypeAssertions May 27, 2024
@dennisdoomen dennisdoomen merged commit 418a327 into fluentassertions:develop Jun 10, 2024
7 checks passed
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.

Allow Should().Satisfy() on objects and not only collections
6 participants