Part of this involves testing that various properties catch Exceptions if set to null, so I don't need to extensively check this later on in the program and slow down my heuristics.
What I'm interested in, is if anyone knows of an easy way of testing for Exceptions being thrown, or a better technique than below:
Expand|Select|Wrap|Line Numbers
- try
- {
- value1 = null
- }
- catch(NullReferenceException)
- {
- try
- {
- value2 = null;
- }
- catch(NullReferenceException)
- {
- return;
- }
- }
- Assert.Fail("Null Reference Exceptions were not thrown");