refactor!: rename TimeProvider to TimeProviderFactory#1045
Merged
Conversation
TimeProvider to TimeProviderFactoryTimeProvider to TimeProviderFactory
Test Results 101 files - 1 101 suites - 1 2h 21m 23s ⏱️ - 8m 0s 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.This pull request removes 12552 skipped tests and adds 11853 skipped tests. Note that renamed tests count towards both. |
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.
3cf90ff to
6b4276d
Compare
|
|
This is addressed in release v7.0.0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The static
Testably.Abstractions.Testing.TimeProviderfactory shadows the BCLSystem.TimeProviderfrom within theTestably.Abstractions.Testingnamespace, which is why the newToTimeProvider()bridge has to fully-qualifySystem.TimeProvidereverywhere. Rename it toTimeProviderFactory, which also reads more accurately because itsNow(),Random()andUse()methods return anITimeProviderFactory.The old
TimeProvidertype is kept as an[Obsolete]shim that forwards toTimeProviderFactory, so existing callers keep compiling (with a deprecation warning) until it is removed in a future major version.ITimeProvider,ITimeProviderFactoryand theMockTimeSystem.TimeProviderproperty are intentionally left unchanged, mirroring theIRandomProvider/MockRandomSystem.RandomProvidernaming 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.
System.TimeProvider#1040