-
Notifications
You must be signed in to change notification settings - Fork 849
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-fundamentals
Description
Background and motivation
I'm using reflection to get around FakeTimeProvider inability to go backwards. Would be nice if a bool could be added to allow setting time earlier.
Thanks for considering.
API Proposal
public sealed class FakeTimeProvider : TimeProvider
{
public bool AllowBackwardsTimeProgression { get; set; }
}API Usage
// Fancy the value
FakeTimeProvider t = ...
t.AllowBackwardsTimeProgression = true;
t.SetUtcNow(new DateTimeOffset(1990, 1, 1, 1, 1, 1));
t.SetUtcNow(new DateTimeOffset(1984, 1, 1, 1, 1, 1));Alternative Designs
No response
Risks
None I can think of. This new property will default to false.
Dreamescaper, pebezo, anderaus and colejohnson66
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-fundamentals