Hacker News new | ask | show | jobs
by 0xcoffee 951 days ago
They also added a TimeProvider to help with testing time objects. Maybe one day we will also get an FileSystemProvider..

TimeProviderFake: https://learn.microsoft.com/en-us/dotnet/api/microsoft.exten...

ReleaseNotes: https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotn...

2 comments

> Maybe one day we will also get an FileSystemProvider.

Until then you can use System.IO.Abstraction[1] if you aren't already :)

[1] https://github.com/TestableIO/System.IO.Abstractions

This is what I use, but damn, does it make coding a bit annoying having to have an instance of the filesystem rather than using static classes like Path.
Thah. Made a "stupid" joke about this ( naming).

> If you lack time to finish something, use the TimeProvider. It provides time.