Skip to content

Instantly share code, notes, and snippets.

@johnnonolan
Created March 16, 2012 15:28
Show Gist options
  • Save johnnonolan/2050540 to your computer and use it in GitHub Desktop.
Save johnnonolan/2050540 to your computer and use it in GitHub Desktop.
look ma no null reference exceptions!
public class When_blah
{
static string s;
Establish that = () => s = null;
Because of = () => s= s.MyExt();
It should_be_null = () => s.ShouldBeNull();
}
public static class MyExts
{
public static string MyExt(this string s)
{
return s;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment