Skip to content

test: round-4 coverage expansion across 10 more sync operators#168

Closed
glennawatson wants to merge 1 commit into
mainfrom
tests/expand-operator-coverage-round-4
Closed

test: round-4 coverage expansion across 10 more sync operators#168
glennawatson wants to merge 1 commit into
mainfrom
tests/expand-operator-coverage-round-4

Conversation

@glennawatson
Copy link
Copy Markdown
Contributor

Summary

Fourth round of coverage tests, prioritised by uncovered-line count. All 10 targets are small synchronous operators where the existing happy-path tests already cover the main flow — these tests fill in the terminal-notification (error / completion / dispose) and conditional branches.

Classes covered

  • DetectStaleObservable — error / completion forwarding
  • BufferUntilIdleObservable — error path flushes the pending buffer before forwarding the error
  • DebounceImmediateObservable — first-value-inline + debounced tail, flush-then-complete, flush-then-error
  • DebounceUntilObservable — condition-true immediate bypass + condition-false debounce
  • ScheduledValueObservable — relative-delay + absolute-due-time value scheduling
  • ScheduledSourceObservable — relative-delay + absolute-due-time per-emission scheduling
  • LatestOrDefaultObservable — seed-first + distinct-until-changed + error forwarding
  • PairwiseObservable — adjacent pairs, single-element completes empty, error forwarding
  • WaitUntilObservable (sync) — first-match emit-and-complete, error forwarding
  • SwitchIfEmptyObservable — fallback on empty, passthrough on non-empty, error forwarding without switching

Notes

  • The Schedule overloads for values and sources have intentionally different semantics; tests assert against the actual contract (e.g. ScheduledValueObservable does not auto-complete after emit; ScheduledSourceObservable subscribes synchronously and only delays per-emission dispatch).
  • All analyzer rules satisfied without project-wide suppressions.

Test plan

  • dotnet build ReactiveUI.Extensions.slnx -c Release -warnaserror — clean
  • dotnet test --solution ReactiveUI.Extensions.slnx -c Release — 4677 tests, 0 failed across net8.0 / net9.0 / net10.0

- DetectStaleObservable: error / completion forwarding
- BufferUntilIdleObservable: error path flushes pending buffer before forwarding
- DebounceImmediateObservable: first-inline + debounce, flush-then-complete, flush-then-error
- DebounceUntilObservable: condition-true immediate bypass + condition-false debounce
- ScheduledValueObservable: relative-delay + absolute-due-time value scheduling
- ScheduledSourceObservable: relative-delay + absolute-due-time per-emission scheduling
- LatestOrDefaultObservable: seed + distinct + error forwarding
- PairwiseObservable: adjacent pairs, single-element completes empty, error forwarding
- WaitUntilObservable (sync): first-match emit-and-complete, error forwarding
- SwitchIfEmptyObservable: fallback on empty, passthrough on non-empty, error forwarding
public async Task WhenDetectStaleSourceErrors_ThenForwardsError()
{
var scheduler = new TestScheduler();
var subject = new Subject<int>();
public async Task WhenDetectStaleSourceCompletes_ThenForwardsCompletion()
{
var scheduler = new TestScheduler();
var subject = new Subject<int>();
public async Task WhenBufferUntilIdleSourceErrors_ThenFlushesThenForwardsError()
{
var scheduler = new TestScheduler();
var subject = new Subject<int>();
public async Task WhenDebounceImmediate_ThenFirstInlineThenDebouncedTail()
{
var scheduler = new TestScheduler();
var subject = new Subject<int>();
public async Task WhenDebounceImmediateCompletesWithPending_ThenFlushesThenCompletes()
{
var scheduler = new TestScheduler();
var subject = new Subject<int>();
public async Task WhenDebounceImmediateSourceErrors_ThenFlushesThenForwardsError()
{
var scheduler = new TestScheduler();
var subject = new Subject<int>();
public async Task WhenDebounceUntilConditionTrue_ThenImmediate()
{
var scheduler = new TestScheduler();
var subject = new Subject<int>();
public async Task WhenDebounceUntilConditionFalse_ThenDebounced()
{
var scheduler = new TestScheduler();
var subject = new Subject<int>();
[Test]
public async Task WhenLatestOrDefault_ThenSeedThenDistinctValues()
{
var subject = new Subject<int>();
[Test]
public async Task WhenLatestOrDefaultSourceErrors_ThenForwardsError()
{
var subject = new Subject<int>();
@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.75%. Comparing base (d1587e5) to head (41dd738).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #168      +/-   ##
==========================================
+ Coverage   92.61%   92.75%   +0.14%     
==========================================
  Files         224      224              
  Lines        8503     8503              
  Branches      930      930              
==========================================
+ Hits         7875     7887      +12     
+ Misses        410      400      -10     
+ Partials      218      216       -2     

☔ 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
Copy link
Copy Markdown
Contributor Author

Folding into #167 — single PR for the test-coverage initiative.

@glennawatson glennawatson deleted the tests/expand-operator-coverage-round-4 branch May 19, 2026 00:33
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.

1 participant