Solution 1:

The Storage Library doesn't have an interface to use for mocking, so if you wanted to really mock this out I think you have two options:

  1. Create an interface yourself and hide the interaction with the storage library behind a class of your own. Then use your interface for the mocked tests. This is something I've done a lot of in the past, trying to abstract the use of the storage library away from the rest of the app. Of course, you can do this abstraction in your own code, or the storage library is out on GitHub. You could fork it and start adding interfaces to make the mocking easier. I think you'd have less work to just create an interface in your own code and a concrete implementation that did the necessary work to interact with the storage sub system for the things specific to your scenarios.

  2. Use a mocking framework that is capable of interception and can mock out types without interfaces. Something like TypeMock. There are others out there as well, both free and commercial.

Solution 2:

you can use Microsoft fakes, its simple and easy a free alternative for typemock