feat(dummies): add WithOffset/WithOffsetBetween on AnyDateTimeOffset - #299
Merged
Conversation
Give AnyDateTimeOffset an opt-in offset dimension (split from #226): WithOffset(TimeSpan) pins a whole-minute offset (±14:00) and WithOffsetBetween(min, max) draws a bounded one, so offset-sensitive code (local rendering, offset arithmetic, "same instant, different offset") is exercised. The unconstrained default stays TimeSpan.Zero, so this is non-breaking. The instant is tightened at declaration so the local ticks stay in range for every admitted offset; the offset is then an independent, always-valid draw, and an instant window with no room for the offset conflicts eagerly through the existing interval engine. Adds the two methods to the netstandard2.0 and net8.0 public API, gives AnyDateTimeOffset its own surface-parity family, documents the dimension in the Dummies readme, and proposes ADR-0037. Refs: #297 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JpQ9768mubATEjedfdAZus
Reefact
force-pushed
the
claude/anydatetimeoffset-withoffset-297
branch
from
July 26, 2026 12:33
3210e3b to
47f9446
Compare
Reefact
enabled auto-merge
July 26, 2026 12:34
Reefact
added a commit
that referenced
this pull request
Jul 26, 2026
ADR-0037 ("Vary the DateTimeOffset offset dimension") records the decision
behind the WithOffset/WithOffsetBetween constraints that shipped in #299. The
maintainer accepts the decision; the Date stays 2026-07-26, the day it took
effect.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JpQ9768mubATEjedfdAZus
4 tasks
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.
Summary
Give
AnyDateTimeOffsetan opt-in offset dimension:WithOffset(TimeSpan)pins a whole-minute offset (±14:00) andWithOffsetBetween(min, max)draws a bounded one, so offset-sensitive code can be exercised. Today the offset is alwaysTimeSpan.Zero, so the common latent bug "the code assumes offset == 0" is never surfaced. The unconstrained default staysTimeSpan.Zero, so the change is non-breaking.Type of change
Changes
WithOffset(TimeSpan)(pin) andWithOffsetBetween(TimeSpan, TimeSpan)(bounded draw) onAnyDateTimeOffset; whole-minute offsets within ±14:00; declared once per generator.localTicks = UtcTicks + offsetstays valid for every admitted offset; the offset is then an independent, always-valid draw, and an instant window with no room for the offset conflicts eagerly through the existing interval engine.OneOfvalues are returned verbatim (offset included); the offset dimension governs only the constructed draw.SurfaceParityTestsfamily forAnyDateTimeOffset; behavioural + edge + conflict tests inAnyDateTimeOffsetOffsetTests.Testing
dotnet build FirstClassErrors.slndotnet test FirstClassErrors.slnFirstClassErrors.Analyzers.UnitTests)Documentation
doc/updatedArchitecture decisions
Proposed: ADR-0037Related issues
Closes #297
Refs #226
🤖 Generated with Claude Code
https://claude.ai/code/session_01JpQ9768mubATEjedfdAZus
Generated by Claude Code