feat: implement mock DateTimeOffset in testing package#1050
Merged
Conversation
Test Results 102 files ± 0 102 suites ±0 2h 27m 25s ⏱️ - 2m 12s Results for commit 747ef8f. ± Comparison against base commit ac3d576. This pull request removes 109734 and adds 109751 tests. Note that renamed tests count towards both.This pull request removes 12552 skipped tests and adds 12552 skipped tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Adds the mock implementation of `IDateTimeOffset` to `MockTimeSystem`, replacing the temporary stub from the `TimeZoneInfo` mock change. - Implement `DateTimeOffsetMock` and expose it via `MockTimeSystem.DateTimeOffset`; it shares the same underlying `ITimeProvider` clock as `IDateTime`. - `Now` derives its offset from the configured local time zone (`ITimeProvider.LocalTimeZone`) so it is deterministic and DST-aware, while `UtcNow` uses a zero offset and the value constants mirror `ITimeProvider`. - Add a `DateTimeOffsetRead` notification callback for parity with `DateTimeRead`. - Share the runtime-agnostic `IDateTimeOffset` tests (incl. a Now/UtcNow round-trip invariant) so they run against the real and mock implementation. - Document `DateTimeOffset` in the time-system docs.
e637104 to
747ef8f
Compare
747ef8f to
74dd6db
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.



Adds the mock implementation of
IDateTimeOffsettoMockTimeSystem, replacing the temporary stub from theTimeZoneInfomock change.DateTimeOffsetMockand expose it viaMockTimeSystem.DateTimeOffset; it shares the same underlyingITimeProviderclock asIDateTime.Nowderives its offset from the configured local time zone (ITimeProvider.LocalTimeZone) so it is deterministic and DST-aware, whileUtcNowuses a zero offset and the value constants mirrorITimeProvider.DateTimeOffsetReadnotification callback for parity withDateTimeRead.IDateTimeOffsettests (incl. a Now/UtcNow round-trip invariant) so they run against the real and mock implementation.DateTimeOffsetin the time-system docs.