Guest User

Untitled

a guest
Jul 16th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. [Test]
  2. public void Should_pass_when_exception_is_of_correct_type()
  3. {
  4. Action<int> a = s => { throw new ApplicationException(); };
  5. 1.ShouldThrow(typeof(ApplicationException)).WhenCalling(a);
  6. }
  7.  
  8. [Test]
  9. [ExpectedException(typeof(AssertionException))]
  10. public void Should_fail_when_exception_is_of_correct_type()
  11. {
  12. Action<string> a = (s)=> { throw new ArgumentNullException("");};
  13. "foo".ShouldThrow(typeof(ApplicationException)).WhenCalling(a);
  14. }
Add Comment
Please, Sign In to add comment