Skip to content

Instantly share code, notes, and snippets.

@codescribler
Created April 30, 2014 11:10
Show Gist options
  • Save codescribler/fa7f4e3b87f1973382c0 to your computer and use it in GitHub Desktop.
Save codescribler/fa7f4e3b87f1973382c0 to your computer and use it in GitHub Desktop.
public class Scribe
{
public void SaveMessage(string file, string data)
{
if (File.Exists( file )) // How do you test this code??
{
throw new Exception("File name must be unique");
}
File.WriteAllText(path, data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment