Skip to content

Instantly share code, notes, and snippets.

@TheFo2sh
Created April 26, 2020 22:49
Show Gist options
  • Save TheFo2sh/caf664c53400265c051967c75f4c5b69 to your computer and use it in GitHub Desktop.
Save TheFo2sh/caf664c53400265c051967c75f4c5b69 to your computer and use it in GitHub Desktop.
public interface IFileSystem
{
File CreateFile(string filename);
void DeleteFile(string filename);
File GetFile(string filename);
public File GetOrCreateFile(string filename)
{
var file = GetFile(filename);
if (file == null)
file = CreateFile(filename);
return file;
}
}
public class WindowsFileSystem : IFileSystem
{
public File CreateFile(string filename)
{
throw new System.NotImplementedException();
}
public void DeleteFile(string filename)
{
throw new System.NotImplementedException();
}
public File GetFile(string filename)
{
throw new System.NotImplementedException();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment