Initial commit
This commit is contained in:
commit
67196c7395
13 changed files with 4693 additions and 0 deletions
19
PetsAndFleas/DateTimeProvider.cs
Normal file
19
PetsAndFleas/DateTimeProvider.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
namespace PetsAndFleas;
|
||||
|
||||
/// <summary>
|
||||
/// Provides the current time
|
||||
/// </summary>
|
||||
public sealed class DateTimeProvider
|
||||
{
|
||||
private DateTime? _overriddenDateTime;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current time.
|
||||
/// Can be set to a specific value which will then be returned in the future.
|
||||
/// </summary>
|
||||
public DateTime Now
|
||||
{
|
||||
get => _overriddenDateTime ?? DateTime.Now;
|
||||
set => _overriddenDateTime = value;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue