Skip to content

Conversation

@arocheleau
Copy link
Contributor

@arocheleau arocheleau commented Jun 19, 2024

The call to RaisePropertyChangeFor on EventAssertions<T> now returns a filtered list of events related to the property given as parameter. The NotRaisePropertyChangeFor function has been revised as well to match the behavior of RaisePropertyChangeFor especially when the parameter provided is null.

This fixes #393.

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 Jun 19, 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

@arocheleau arocheleau changed the title Filter the list of events returned by RaisePropertyChangedFor Filter the list of events returned by RaisePropertyChangeFor Jun 19, 2024
@coveralls
Copy link

coveralls commented Jun 19, 2024

Pull Request Test Coverage Report for Build 9584175842

Details

  • 23 of 23 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 97.583%

Totals Coverage Status
Change from base Build 9550728512: 0.005%
Covered Lines: 12105
Relevant Lines: 12288

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 19, 2024

Pull Request Test Coverage Report for Build 9584308904

Details

  • 23 of 23 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 97.583%

Totals Coverage Status
Change from base Build 9550728512: 0.005%
Covered Lines: 12105
Relevant Lines: 12288

💛 - Coveralls

@arocheleau arocheleau marked this pull request as ready for review June 19, 2024 15:15
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.

Nice pull request. Lots of tricky situations to consider.

@arocheleau arocheleau force-pushed the bug/393/count-raise-property-changed branch from 8d875b5 to 2bb5a3c Compare July 30, 2024 20:02
@coveralls
Copy link

coveralls commented Jul 30, 2024

Pull Request Test Coverage Report for Build 10380338666

Details

  • 20 of 20 (100.0%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.003%) to 97.716%

Files with Coverage Reduction New Missed Lines %
Src/FluentAssertions/Events/EventAssertions.cs 1 98.55%
Totals Coverage Status
Change from base Build 10355201129: 0.003%
Covered Lines: 12112
Relevant Lines: 12286

💛 - Coveralls

@dennisdoomen
Copy link
Member

@arocheleau just to be clear, if you have addressed the comments, please mark them as resolved and re-request a review. Then I'll know when to look at the rework.

@arocheleau arocheleau requested a review from dennisdoomen August 5, 2024 14:24
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

@dennisdoomen dennisdoomen requested a review from jnyrup August 7, 2024 18:22
subject.RaiseEventWithSenderAndPropertyName(nameof(EventRaisingClass.SomeOtherProperty));

// Act
monitor.Should().RaisePropertyChangeFor(x => x.SomeProperty).Count().Should().Be(2);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
monitor.Should().RaisePropertyChangeFor(x => x.SomeProperty).Count().Should().Be(2);
monitor.Should().RaisePropertyChangeFor(x => x.SomeProperty).Should().HaveCount(2);

@dennisdoomen
Copy link
Member

@arocheleau Let me know if you want to do something with the suggestions from @jnyrup so we know when to merge this PR.

@arocheleau arocheleau force-pushed the bug/393/count-raise-property-changed branch from b315f16 to 926081a Compare August 14, 2024 02:12
@arocheleau arocheleau force-pushed the bug/393/count-raise-property-changed branch from 926081a to 12ad8cc Compare August 14, 2024 02:21
@arocheleau
Copy link
Contributor Author

@dennisdoomen I have applied the suggestions from @jnyrup

@dennisdoomen dennisdoomen merged commit 69c15b8 into fluentassertions:develop Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ShouldRaisePropertyChangedFor followed by Count behaves unexpectedly (solution here)

5 participants