Uh oh!
There was an error while loading. Please reload this page.
refactor: improve and consolidate interfaces - #906
Conversation
- Enable Nullable reference types - Consolidate naming in factory methods - Add missing methods
@fgreinacher : |
Uh oh!
There was an error while loading. Please reload this page.
vbreuss
commented
Nov 13, 2022
@fgreinacher :
|
fgreinacher
commented
Nov 14, 2022
Sorry @vbreuss, I'll have a look today! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
fgreinacher
left a comment
There was a problem hiding this comment.
Thanks a lot @vbreuss, this looks great, I left some suggestions/questions!
…erBase.cs Co-authored-by: Florian Greinacher <florian@greinacher.de>
vbreuss
commented
Nov 14, 2022
Thanks for the review, @fgreinacher ! I implemented all review findings and answered your questions :-) Are the next planned steps also OK for you?
|
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Florian Greinacher <florian@greinacher.de>
fgreinacher
left a comment
There was a problem hiding this comment.
Thanks again for your hard work here!
The next steps are also fine from my side 👍
vbreuss
commented
Nov 14, 2022
@fgreinacher : Is there anything I can do? |
fgreinacher
commented
Nov 14, 2022
All good, sometimes it just takes a bit 🐌 |
- Apply renamings done in System.IO.Abstractions (see [Pull Request #906](TestableIO/System.IO.Abstractions#906)) - Use `global using Testably.Abstractions.FileSystem` so that it can be more easily replaced with another namespace - Add `IFileSystemEntity` to `IFileSystemInfo` - Remove nesting from IWaitForChangedResult
Make the following changes for the interfaces:
New; so instead ofnew DirectoryInfo(path)you should useIFileSystem.DirectoryInfo.New(path). The previous existing factory methods were kept and marked asObsolete.Wrapmethod to the factory interfaces that can be used instead of a direct cast (which is not possible for interfaces) to create a wrapped interface from a "System.IO" type.WriteAllLinesAsyncwith array overload, as it is not defined inSystem.IOand overload resolution will automatically use theIEnumerableoverload.ResolveLinkTargetandCreateAsSymbolicLinkFileSystemStream.Note: This should fix the issues from feat: Add
NametoIFile.Create(and others) #793 , right?Added the following extensibility measures:
IFileSystem FileSystemproperty to more classes to enable implementing extension methods.This was simplified by adding a base interface
IFileSystemExtensionPointIFileSystemExtensibility Extensibilityproperty onIFileSystemInfoandIFileSystemStreamwhich grants access to the underlying wrapped instance or to a metadata dictionary to store additional information together with the instance.