I was wondering if there already existed some sample data of a fake/moq filesystem for unit testing?
Instead of using DirectoryInfo/FileInfo, I am using System.IO.Abstractions and would like to take some existing code that already built out a large/fake file system with directories/subdirectories, etc. rather than having to write my own or generate lots of fake data.
Verify call to File.Delete with System.IO.Abstractions.TestingHelpers
What I don't want to do is manually create the entire system myself:
var mockFileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
{
{ @"c:Test", new MockDirectoryData() },
{ @"c:Testsubfolder1myNewFile.txt", new MockFileData(string.Empty) }
});
But instead, just load from a file or code that has lots of files with different sizes, dates, names, extensions, etc.
question from:
https://stackoverflow.com/questions/65670910/moq-ifilesystem-lots-of-data-sample-code-needed 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…