Repository navigation
[0.9.0] - 2026-06-12: observe timer fires
Minor release. Adds fire observation to ObservableTimeProvider: a count of how many times timer callbacks ran, next to the existing leak and pending-due assertions. Purely additive. Also corrects stale guidance in the docs.
Added
Assert.That(time).HasTimerFiredCount(int expected),HasNoTimerFired(), andHasTimerFiredAtLeast(int count)assert how many times timer callbacks fired across every timer the provider created.ObservableTimeProvidernow wraps each timer callback to count its fires. The count is cumulative and is not reset on disposal. With aFakeTimeProvider, a fire is counted each time test code advances fake time past a due or period boundary, which keeps the count deterministic.ObservableTimeProvider.TimerFireCount(cumulative) andActiveTimerInfo.TimesFired(per timer) expose the same data on the framework-agnostic core.ObservableTimeProvider.CreateTimernow validates that the callback is non-null up front (ArgumentNullException), matching the rest of the surface, instead of deferring to the inner provider.
Fixed
- Once a periodic timer fires,
NextTimerDueTime(and theHasNextTimerDueApproximately/HasPendingTimerDueWithinassertions) now report the timer's period, since that is when the next callback is due. A fired one-shot timer is disabled and drops out of the pending-due calculation. Previously the due time stayed frozen at its creation value until an explicitChange. - Corrected stale documentation that claimed the package "deliberately does not ship its own polling assertion": it has shipped
HasNoActiveTimersEventuallyand its count-targeted siblings since0.7.0/0.8.0. The README and theActiveTimerAssertionsXML docs now point to those overloads for the asynchronous disposal race, reserving genericEventuallyfor arbitrary conditions.
Changed
- Bumped
PackageValidationBaselineVersionfrom0.7.0to0.8.1on both packages so ApiCompat strict-mode validates0.9.0against the most recently published baseline. The new members are recorded as additive differences inCompatibilitySuppressions.xml.