Skip to content

fix: add regression tests for #515 and #665 - #879

Merged
glennawatson merged 2 commits into
mainfrom
glennawatson/fix-515-665
Feb 28, 2026
Merged

glennawatson merged 2 commits into
mainfrom
glennawatson/fix-515-665

Conversation

@glennawatson

Copy link
Copy Markdown
Collaborator

Summary

Fixes #515
Fixes #665

Both issues have been confirmed as no longer reproducible on the current codebase. This PR adds regression tests to ensure they stay fixed.

#665 - ObjectDisposedException thrown

  • Added test: disposing a ValidationHelper with active bindings does not throw
  • Added test: disposing a ViewModel with active ErrorsChanged subscriptions does not throw
  • Added test: clearing validation rules while IsValid() is subscribed does not throw

#515 - HasErrors incorrect when performing a side effect from WhenAnyPropertyChanged

  • Added test: HasErrors reflects correct state inside a WhenAnyValue callback after property changes
  • Added test: HasErrors reflects correct state for cross-field validation (MinValue/MaxValue) inside a property change side effect

Test plan

  • All 5 new tests pass on net8.0, net9.0, net10.0
  • Full test suite (573 tests) passes with no regressions

- Add regression tests for HasErrors timing in property change callbacks (#515)
- Add MinValue/MaxValue properties to IndeiTestViewModel for cross-field validation testing
@glennawatson
glennawatson requested a review from Copilot February 28, 2026 10:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds regression coverage to ensure previously fixed issues (#515 HasErrors timing in reactive side-effects, #665 ObjectDisposedException on disposal/clearing with active subscriptions/bindings) remain non-reproducible within the ReactiveUI.Validation test suite.

Changes:

  • Added 5 regression tests around disposal safety and HasErrors correctness in reactive callbacks.
  • Extended IndeiTestViewModel with MinValue/MaxValue to support cross-field validation regression testing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/tests/ReactiveUI.Validation.Tests/NotifyDataErrorInfoTests.cs Adds new regression tests for #515 and #665 scenarios (disposal, clearing rules with active subscriptions, HasErrors correctness in reactive callbacks).
src/tests/ReactiveUI.Validation.Tests/Models/IndeiTestViewModel.cs Adds MinValue/MaxValue properties to support cross-field validation regression tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Assert full HasErrors sequence instead of just last value
- Fix XML doc to reference WhenAnyValue instead of WhenAnyPropertyChanged
@codecov

codecov Bot commented Feb 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (737b280) to head (7698c26).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #879   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines          675       675           
  Branches       113       113           
=========================================
  Hits           675       675           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@glennawatson
glennawatson merged commit 406c372 into main Feb 28, 2026
6 checks passed
@glennawatson
glennawatson deleted the glennawatson/fix-515-665 branch February 28, 2026 11:03
@github-actions

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ObjectDisposedException thrown [Bug]: HasErrors is incorrect when performing a side effect from WhenAnyPropertyChanged

3 participants

⌂ 换网址