PrimeTime testing packages
PrimeTime ships testing APIs in dedicated packages so production packages can stay focused on runtime clock/timer usage.
Testing package mapping
Choose the testing package that matches your production package:
| Production package | Testing package | Namespace |
|---|---|---|
KZDev.PrimeTime |
KZDev.PrimeTime.Testing |
KZDev.PrimeTime |
KZDev.SystemClock.PrimeTime |
KZDev.SystemClock.PrimeTime.Testing |
KZDev.SystemClock.PrimeTime |
The testing packages keep the same namespace family as their production counterparts.
Testing APIs in these packages
Testing-focused contracts and implementations are delivered via the testing packages, including:
IPrimeTestClockIPrimeTestTimePrimeTestClock
System Clock stack (BCL / TimeProvider)
Use KZDev.SystemClock.PrimeTime with KZDev.SystemClock.PrimeTime.Testing when your production code stays on TimeProvider and BCL date/time types.
Installation
dotnet add package KZDev.SystemClock.PrimeTime
dotnet add package KZDev.SystemClock.PrimeTime.Testing
Dependency injection for tests
Use extension methods from KZDev.SystemClock.PrimeTime.Testing to replace runtime clock services with virtual time in tests.
Runnable testing examples
Browse the dedicated example pages:
System Clock-specific examples
- Interval timer (testing) — deterministic interval timers under
PrimeTestClockwithAdvance. - Time-of-day and DST (testing) — environment-aware DST probes plus stable virtual-clock advancement.
Cross-track testing examples (both stacks shown side-by-side)
- Test-clock control APIs —
Set*,Advance,RunFor,Start/Stopreference patterns. - DI replacement with
AddPrimeTestClock— substitute virtual time in a Microsoft DI container.
Daylight saving notes
The System Clock testing examples use environment-aware local probes plus virtual-time advancement patterns; the DST page above describes the shape and the host-dependent fallbacks.
Browse from the System Clock track sidebar (Testing API), or open KZDev.SystemClock.PrimeTime.Testing directly.
PrimeTime stack (NodaTime)
Use KZDev.PrimeTime with KZDev.PrimeTime.Testing when your production code uses NodaTime (Instant, Duration, LocalTime, etc.) on IPrimeClock.
Installation
dotnet add package KZDev.PrimeTime
dotnet add package KZDev.PrimeTime.Testing
Dependency injection for tests
Use extension methods from KZDev.PrimeTime.Testing to replace runtime clock services with virtual time in tests.
Runnable testing examples
Browse the dedicated example pages:
PrimeTime-specific examples
- Interval timer (testing) — deterministic interval timers under
PrimeTestClockwithAdvance. - Time-of-day and DST (testing) — deterministic spring-forward and fall-back examples against a fixed NodaTime
DateTimeZone.
Cross-track testing examples (both stacks shown side-by-side)
- Test-clock control APIs —
Set*,Advance,RunFor,Start/Stopreference patterns. - DI replacement with
AddPrimeTestClock— substitute virtual time in a Microsoft DI container.
Daylight saving notes
The PrimeTime testing examples use deterministic zone-based setup (fixed TZDB zones via the NodaTime DateTimeZone constructor of PrimeTestClock) and optionally probe the local environment.
Browse from the PrimeTime track sidebar (Testing API), or open KZDev.PrimeTime.Testing directly.