Last active
August 29, 2015 14:00
-
-
Save codescribler/cfaeaf94b086c2112dad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Scribe2 | |
{ | |
private IWrapFile fileService; | |
public Scribe2(IWrapFile file) | |
{ | |
fileService = file; | |
} | |
public void SaveMessage(string file, string data) | |
{ | |
if (fileService.Exists(file)) // Now uses the injected IWrapFile service | |
{ | |
throw new Exception("File name must be unique"); | |
} | |
fileService.WriteAllText(file, data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment