Skip to content

refactor!: rename TimeProvider to TimeProviderFactory#1045

Merged
vbreuss merged 1 commit into
mainfrom
topic/rename-timeprovider
Jul 10, 2026
Merged

refactor!: rename TimeProvider to TimeProviderFactory#1045
vbreuss merged 1 commit into
mainfrom
topic/rename-timeprovider

Conversation

@vbreuss

@vbreuss vbreuss commented Jul 10, 2026

Copy link
Copy Markdown
Member

The static Testably.Abstractions.Testing.TimeProvider factory shadows the BCL System.TimeProvider from within the Testably.Abstractions.Testing namespace, which is why the new ToTimeProvider() bridge has to fully-qualify System.TimeProvider everywhere. Rename it to TimeProviderFactory, which also reads more accurately because its Now(), Random() and Use() methods return an ITimeProviderFactory.

The old TimeProvider type is kept as an [Obsolete] shim that forwards to TimeProviderFactory, so existing callers keep compiling (with a deprecation warning) until it is removed in a future major version. ITimeProvider, ITimeProviderFactory and the MockTimeSystem.TimeProvider property are intentionally left unchanged, mirroring the IRandomProvider / MockRandomSystem.RandomProvider naming of the sibling random subsystem.

Migrate the internal call sites and tests to the new name, add a test covering the obsolete shim, and regenerate the public API baselines for all target frameworks.


@vbreuss vbreuss self-assigned this Jul 10, 2026
@vbreuss vbreuss added the breaking change The changes require a new major version label Jul 10, 2026
@vbreuss vbreuss changed the title refactor: rename TimeProvider to TimeProviderFactory refactor!: rename TimeProvider to TimeProviderFactory Jul 10, 2026
@github-actions

Copy link
Copy Markdown

Test Results

    101 files   -      1      101 suites   - 1   2h 21m 23s ⏱️ - 8m 0s
106 931 tests  -  5 662   95 020 ✅  -  4 963  11 911 💤  -   699  0 ❌ ±0 
256 621 runs   - 12 469  221 987 ✅  - 10 391  34 634 💤  - 2 078  0 ❌ ±0 

Results for commit 3cf90ff. ± Comparison against base commit 696ffa9.

This pull request removes 109759 and adds 104096 tests. Note that renamed tests count towards both.
  )
)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(0be706b5-98d3-4a22-ad18-f3674a32723b)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(0ef9080e-9a1a-4316-b8a3-6fc6452834b7)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(105354ab-fb15-4339-8d2d-f88066f061e7)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(1708397d-518b-466f-abf4-264b56563dc5)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(2351e0da-4f78-4698-b73a-adf83d72c7fe)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(25787a92-4b56-4f63-a04a-b35dfa13a0de)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(2e219b63-51d0-4f8d-97c9-e5a0250327fd)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(353506a0-c0ac-4917-b666-4519ff84b2f7)
…
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(04187c7f-429d-44f9-abfb-bfc869a45e04)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(0afa88ba-7a72-4949-981d-0c97a82eee79)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(115a9be2-6432-4d2f-835f-02bd794cb4c4)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(11d144b9-fdd8-48ec-8d79-87785c6b8e8a)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(21673e6a-809a-4346-87c7-712619c3465d)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(3df312ac-4332-4b21-ae6c-05d20392c3ff)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(4ab7d39e-5e99-4fa7-a1b4-dc789d4995cc)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(4cae5547-4558-4362-a823-801ac33a5f9a)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(51e31bda-9293-44e4-bb79-94db8918ae01)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(5397b189-fd43-4a25-a0b2-e3bc9fd1796a)
…
This pull request removes 12552 skipped tests and adds 11853 skipped tests. Note that renamed tests count towards both.
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(0be706b5-98d3-4a22-ad18-f3674a32723b)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(0ef9080e-9a1a-4316-b8a3-6fc6452834b7)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(105354ab-fb15-4339-8d2d-f88066f061e7)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(1708397d-518b-466f-abf4-264b56563dc5)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(2351e0da-4f78-4698-b73a-adf83d72c7fe)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(25787a92-4b56-4f63-a04a-b35dfa13a0de)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(2e219b63-51d0-4f8d-97c9-e5a0250327fd)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(353506a0-c0ac-4917-b666-4519ff84b2f7)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(3bef1e0b-591f-4418-899d-c5465456e0c0)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(3e3935fa-95a6-477a-b145-9ed7705849cc)
…
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(04187c7f-429d-44f9-abfb-bfc869a45e04)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(0afa88ba-7a72-4949-981d-0c97a82eee79)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(115a9be2-6432-4d2f-835f-02bd794cb4c4)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(11d144b9-fdd8-48ec-8d79-87785c6b8e8a)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(21673e6a-809a-4346-87c7-712619c3465d)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(3df312ac-4332-4b21-ae6c-05d20392c3ff)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(4ab7d39e-5e99-4fa7-a1b4-dc789d4995cc)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(4cae5547-4558-4362-a823-801ac33a5f9a)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(51e31bda-9293-44e4-bb79-94db8918ae01)
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests ‑ SetAccessControl_ShouldNotUpdateTimes(5397b189-fd43-4a25-a0b2-e3bc9fd1796a)
…

The static `Testably.Abstractions.Testing.TimeProvider` factory shadows the BCL `System.TimeProvider` from within the `Testably.Abstractions.Testing` namespace, which is why the new `ToTimeProvider()` bridge has to fully-qualify `System.TimeProvider` everywhere. Rename it to `TimeProviderFactory`, which also reads more accurately because its `Now()`, `Random()` and `Use()` methods return an `ITimeProviderFactory`.

The old `TimeProvider` type is kept as an `[Obsolete]` shim that forwards to `TimeProviderFactory`, so existing callers keep compiling (with a deprecation warning) until it is removed in a future major version. `ITimeProvider`, `ITimeProviderFactory` and the `MockTimeSystem.TimeProvider` property are intentionally left unchanged, mirroring the `IRandomProvider` / `MockRandomSystem.RandomProvider` naming of the sibling random subsystem.

Migrate the internal call sites and tests to the new name, add a test covering the obsolete shim, and regenerate the public API baselines for all target frameworks.
@vbreuss vbreuss force-pushed the topic/rename-timeprovider branch from 3cf90ff to 6b4276d Compare July 10, 2026 19:20
@vbreuss vbreuss enabled auto-merge (squash) July 10, 2026 19:41
@vbreuss vbreuss disabled auto-merge July 10, 2026 19:42
@vbreuss vbreuss enabled auto-merge (squash) July 10, 2026 19:45
@sonarqubecloud

Copy link
Copy Markdown

@vbreuss vbreuss merged commit c4e0fd4 into main Jul 10, 2026
13 checks passed
@vbreuss vbreuss deleted the topic/rename-timeprovider branch July 10, 2026 19:56
@github-actions

Copy link
Copy Markdown

This is addressed in release v7.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change The changes require a new major version state: released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a bridge to the BCL System.TimeProvider

1 participant