How to mock a directory with sub directories

Sep 2, 2011 at 6:50 PM
Edited Sep 2, 2011 at 6:53 PM

Forgive my confusion. 

But I'm trying to write a test for finding files in a directory or sub directories and processing them. 

After searching I came across this framework which simplifies the mocking of System.IO, however I didn't see any examples to achieve my goal. 

I think it can be done with this framework, I just am not getting the syntax right. 

All I want to do is mockup a Directory with sub directories inside it. 

  • PARENT
    • SUB 1
      • Mock File 1
    • SUB 2
      • Mock File 2

Could you give an example that shows how one can use the SystemWrapper to Mockup a directory with that structure, that can allow a basic iterator to retrieve the files or sub directory mocks while using MOQ framework. 

From what I can see, it appears that this is possible, I'm just doing it wrong..

Thanks