Skip to content

Commit

Permalink
fix: csproj must include a readme
Browse files Browse the repository at this point in the history
  • Loading branch information
egil committed Sep 25, 2023
1 parent 55dc0fe commit eead737
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 37 deletions.
30 changes: 15 additions & 15 deletions docs/TimeProviderExtensions.ManualTimeProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,51 +30,51 @@ This creates a provider whose time is initially set to midnight January 1st 2000
with the local time zone set to [System.TimeZoneInfo.Utc](https://docs.microsoft.com/en-us/dotnet/api/System.TimeZoneInfo.Utc 'System.TimeZoneInfo.Utc').
The provider is set to not automatically advance time each time it is read.

<a name='TimeProviderExtensions.ManualTimeProvider.ManualTimeProvider(System.DateTimeOffset)'></a>
<a name='TimeProviderExtensions.ManualTimeProvider.ManualTimeProvider(System.DateTimeOffset,System.TimeZoneInfo)'></a>

## ManualTimeProvider(DateTimeOffset) Constructor
## ManualTimeProvider(DateTimeOffset, TimeZoneInfo) Constructor

Initializes a new instance of the [ManualTimeProvider](TimeProviderExtensions.ManualTimeProvider.md 'TimeProviderExtensions.ManualTimeProvider') class.

```csharp
public ManualTimeProvider(System.DateTimeOffset startDateTime);
public ManualTimeProvider(System.DateTimeOffset startDateTime, System.TimeZoneInfo localTimeZone);
```
#### Parameters

<a name='TimeProviderExtensions.ManualTimeProvider.ManualTimeProvider(System.DateTimeOffset).startDateTime'></a>
<a name='TimeProviderExtensions.ManualTimeProvider.ManualTimeProvider(System.DateTimeOffset,System.TimeZoneInfo).startDateTime'></a>

`startDateTime` [System.DateTimeOffset](https://docs.microsoft.com/en-us/dotnet/api/System.DateTimeOffset 'System.DateTimeOffset')
The initial time and date reported by the provider.

<a name='TimeProviderExtensions.ManualTimeProvider.ManualTimeProvider(System.DateTimeOffset,System.TimeZoneInfo).localTimeZone'></a>

`localTimeZone` [System.TimeZoneInfo](https://docs.microsoft.com/en-us/dotnet/api/System.TimeZoneInfo 'System.TimeZoneInfo')
Optional local time zone to use during testing. Defaults to [System.TimeZoneInfo.Utc](https://docs.microsoft.com/en-us/dotnet/api/System.TimeZoneInfo.Utc 'System.TimeZoneInfo.Utc').
### Remarks
The local time zone set to [System.TimeZoneInfo.Utc](https://docs.microsoft.com/en-us/dotnet/api/System.TimeZoneInfo.Utc 'System.TimeZoneInfo.Utc').
The provider is set to not automatically advance time each time it is read.

<a name='TimeProviderExtensions.ManualTimeProvider.ManualTimeProvider(System.DateTimeOffset,System.TimeZoneInfo)'></a>
<a name='TimeProviderExtensions.ManualTimeProvider.ManualTimeProvider(System.DateTimeOffset)'></a>

## ManualTimeProvider(DateTimeOffset, TimeZoneInfo) Constructor
## ManualTimeProvider(DateTimeOffset) Constructor

Initializes a new instance of the [ManualTimeProvider](TimeProviderExtensions.ManualTimeProvider.md 'TimeProviderExtensions.ManualTimeProvider') class.

```csharp
public ManualTimeProvider(System.DateTimeOffset startDateTime, System.TimeZoneInfo localTimeZone);
public ManualTimeProvider(System.DateTimeOffset startDateTime);
```
#### Parameters

<a name='TimeProviderExtensions.ManualTimeProvider.ManualTimeProvider(System.DateTimeOffset,System.TimeZoneInfo).startDateTime'></a>
<a name='TimeProviderExtensions.ManualTimeProvider.ManualTimeProvider(System.DateTimeOffset).startDateTime'></a>

`startDateTime` [System.DateTimeOffset](https://docs.microsoft.com/en-us/dotnet/api/System.DateTimeOffset 'System.DateTimeOffset')
The initial time and date reported by the provider.

<a name='TimeProviderExtensions.ManualTimeProvider.ManualTimeProvider(System.DateTimeOffset,System.TimeZoneInfo).localTimeZone'></a>

`localTimeZone` [System.TimeZoneInfo](https://docs.microsoft.com/en-us/dotnet/api/System.TimeZoneInfo 'System.TimeZoneInfo')
Optional local time zone to use during testing. Defaults to [System.TimeZoneInfo.Utc](https://docs.microsoft.com/en-us/dotnet/api/System.TimeZoneInfo.Utc 'System.TimeZoneInfo.Utc').
### Remarks
The local time zone set to [System.TimeZoneInfo.Utc](https://docs.microsoft.com/en-us/dotnet/api/System.TimeZoneInfo.Utc 'System.TimeZoneInfo.Utc').
The provider is set to not automatically advance time each time it is read.
### Properties

Expand Down
31 changes: 9 additions & 22 deletions src/TimeProviderExtensions/TimeProviderExtensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,12 @@
<Company>Egil Hansen</Company>
<Authors>Egil Hansen</Authors>
<Description>
# TimeProvider Extensions

Testing extensions for the [`System.TimeProvider`](https://learn.microsoft.com/en-us/dotnet/api/system.timeprovider) API. It includes:

- An advanced test/fake version of the `TimeProvider` type, named `ManualTimeProvider`, that allows you to control the progress of time during testing deterministically (see the difference to Microsoft's `FakeTimeProvider` below).
- A backported version of `PeriodicTimer` that supports `TimeProvider` in .NET 6.

## Quick start

This describes how to get started:

1. Get the latest release from https://www.nuget.org/packages/TimeProviderExtensions.

2. Take a dependency on `TimeProvider` in your production code. Inject the production version of `TimeProvider` available via the [`TimeProvider.System`](https://learn.microsoft.com/en-us/dotnet/api/system.timeprovider.system?#system-timeprovider-system) property during production.

3. During testing, inject the `ManualTimeProvider` from this library. This allows you to write tests that run fast and predictably.
- Advance time by calling `Advance(TimeSpan)` or `SetUtcNow(DateTimeOffset)` or
- Jump ahead in time using `Jump(TimeSpan)` or `Jump(DateTimeOffset)`.

4. See the **[`ManualTimeProvider API`](https://github.com/egil/TimeProviderExtensions/blob/main/docs/TimeProviderExtensions.ManualTimeProvider.md) page** for the full API documentation for `ManualTimeProvider`.

5. Read the [README](https://github.com/egil/TimeProviderExtensions) for further details and examples.
Testing extensions for the [`System.TimeProvider`](https://learn.microsoft.com/en-us/dotnet/api/system.timeprovider) API. It includes
an advanced test/fake version of the `TimeProvider` type, named `ManualTimeProvider`, that allows you to control the progress of time
during testing deterministically (see the difference to Microsoft's `FakeTimeProvider` below) and a backported version of
`PeriodicTimer` that supports `TimeProvider` in .NET 6.
</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>TimeProvider, testing</PackageTags>
<Copyright>Egil Hansen</Copyright>
<PackageProjectUrl>https://github.com/egil/TimeProviderExtensions</PackageProjectUrl>
Expand Down Expand Up @@ -91,6 +74,10 @@ This describes how to get started:
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit eead737

Please sign in to comment.