Combining VerifyDirectory with System.IO.Abstractions #695
Closed
michael-wolfenden
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
if i could make this (hypothetical) api work, would it suffice?
|
Beta Was this translation helpful? Give feedback.
1 reply
-
i dont have capacity to add support System.IO.Abstractions. I am ahoy for you to create your own project that adds support |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
System.IO.Abstractions is an abstraction over System.IO that it extremely useful for testing IO. At the core of the library is
IFileSystem
. Instead of calling methods likeFile.ReadAllText
directly you useIFileSystem.File.ReadAllText
.The idea is that there would be an overload (or some other method) that allows you to call
VerifyDirectory
with the existing parameters but also passing anIFileSystem
. This would allow you to build an entire mock file system in memory and then callVerifyDirectory
to verify it's contents.For example:
I imagine the implementation would be exactly the same as the existing implementation but replacing
Directory.EnumerateFiles
withIFileSystem.Directory.EnumerateFiles
etc. I supposeVerifyFile
could also be implemented as well.I did attempt to implement myself however the existing implementation of
VerifyDirectory
relies heavily on a number of internal classes and methods.Beta Was this translation helpful? Give feedback.
All reactions