Created
November 1, 2009 15:18
-
-
Save kkozmic/223552 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
//rather than this... | |
var ex = Assert.Throws<FooException>(()=>foo.DoFoo("bar")); | |
Assert.Contains("bar should be foo", ex.Message); | |
// ... I'd prefer this | |
Assert.Throws<FooException>(()=>foo.DoFoo("bar"),(ex)=> | |
Assert.Contains("bar should be foo", ex.Message)); | |
//it's cleaner to read, especially for more complicated scenarios. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment