Manage Time-Related code via `TimeProvider` (.NET8)
See original GitHub issueIn order to improve the testability of the system FastEndpoints should not depend on DateTime.UtcNow
.
It’s highly advisable to introduce a System Time Provider.
Issue Analytics
- State:
- Created 3 months ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Writing Unit Tests with Time in .NET 8 Preview 4 - InfoQ
NET 8 Preview 4 introduces TimeProvider and ITimer, universal time abstractions for dependency injection and unit testing.
Read more >.NET 8 TimeProvider and Unit Tests | ...
Let's look at a complete timer test. The previous code creates a timer, but we only execute the callback when the time is...
Read more >TimeProvider Class (System)
Gets a TimeProvider that provides a clock based on UtcNow, a time zone based on Local, a high-performance time stamp based on Stopwatch,...
Read more >A New Way To Deal With Time In .NET 8 - YouTube
Join me on Patreon to get the source code : https://www.patreon.com/juliocasal My Free . NET Backend Developer Roadmap: ...
Read more >The Problem with Time That .NET 8 Finally Fixed - YouTube
NET 8 type, called TimeProvider, which aims to solve a problem that has been in ... Keep coding merch: https://keepcoding.shop #csharp #dotnet.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@MrBogomips implemented in
v5.13.0.1-beta
. see changelog here: https://github.com/FastEndpoints/FastEndpoints/blob/main/Src/Library/changelog.md#-newand i believe the
FastEndpoints.Security
package is the only place we need to use theTimeProvider
in, since all other places don’t seem to effect what the end user can interact with.if you find something else that requires the use of
TimeProvider
, do let me know and it will be easy to add support for that.will look in to that when i get a chance…