[英]System.IO.Abstractions usage
I'm writing some unit tests using System.IO.Abstractions following the sample code in GitHub and got stuck here: 我正在按照GitHub中的示例代码使用System.IO.Abstractions编写一些单元测试,并被卡在此处:
fileSystem: new FileSystem() //use default implementation which calls System.IO
This line is meant to initialise System.IO.FileSystem but that class does not exist... do you know if it has been deprecated or am I getting this wrong? 该行用于初始化System.IO.FileSystem,但该类不存在...您知道它是否已被弃用,还是我弄错了?
Thanks! 谢谢!
yes, in the production code, you should inject an instance of System.IO.Abstractions.FileSystem
. 是的,在生产代码中,应该注入
System.IO.Abstractions.FileSystem
的实例。 In your test code an instance of System.IO.Abstractions.TestingHelpers.MockFileSystem
. 在您的测试代码中,有一个
System.IO.Abstractions.TestingHelpers.MockFileSystem
的实例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.