Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Test]
- public void Should_pass_when_exception_is_of_correct_type()
- {
- Action<int> a = s => { throw new ApplicationException(); };
- 1.ShouldThrow(typeof(ApplicationException)).WhenCalling(a);
- }
- [Test]
- [ExpectedException(typeof(AssertionException))]
- public void Should_fail_when_exception_is_of_correct_type()
- {
- Action<string> a = (s)=> { throw new ArgumentNullException("");};
- "foo".ShouldThrow(typeof(ApplicationException)).WhenCalling(a);
- }
Add Comment
Please, Sign In to add comment