Skip to content

feat: Add Fake Time Provider extension generator#478

Merged
Keboo merged 1 commit into
masterfrom
time-provider
May 28, 2026
Merged

feat: Add Fake Time Provider extension generator#478
Keboo merged 1 commit into
masterfrom
time-provider

Conversation

@Keboo

@Keboo Keboo commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Introduces a source generator that creates a WithFakeTimeProvider() extension method for AutoMocker.

This streamlines deterministic testing of time-sensitive components by automatically registering FakeTimeProvider from Microsoft.Extensions.TimeProvider.Testing. It registers the fake provider as both TimeProvider (for injection) and FakeTimeProvider (for test control).

Includes new documentation and example tests across various test frameworks.

@Keboo Keboo enabled auto-merge (squash) May 28, 2026 21:01
Introduces a source generator that creates a `WithFakeTimeProvider()` extension method for `AutoMocker`.

This streamlines deterministic testing of time-sensitive components by automatically registering `FakeTimeProvider` from `Microsoft.Extensions.TimeProvider.Testing`. It registers the fake provider as both `TimeProvider` (for injection) and `FakeTimeProvider` (for test control).

Includes new documentation and example tests across various test frameworks.
@Keboo Keboo merged commit 9b43cd5 into master May 28, 2026
3 checks passed
@Keboo Keboo deleted the time-provider branch May 28, 2026 21:18
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