Skip to content

Instantly share code, notes, and snippets.

@theorigin
Created October 29, 2013 13:41
Show Gist options
  • Save theorigin/7214838 to your computer and use it in GitHub Desktop.
Save theorigin/7214838 to your computer and use it in GitHub Desktop.
An interface definition for the System.IO.Directory class. Allows mocking of code that uses any of these methods
namespace VS.Library.Interfaces
{
using System.Collections.Generic;
using System.IO;
using System.Security.AccessControl;
public interface IDirectory
{
bool Exists(string path);
IEnumerable<string> GetFiles(string path, string searchPattern);
DirectoryInfo CreateDirectory(string path);
DirectoryInfo CreateDirectory(string path, DirectorySecurity directorySecurity);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment