provegard/testness — Issue #15: Handle assertion of exception properties
Author: provegard
Created: 2011-11-17 13:54:14+00:00
State: open

In some cases it makes sense to catch an exception within a test method, specifically to assert properties on the exception, or even the exception message (MSTest, for example, has no attribute for testing the exception message).

This would look like:

```
try
{
...
(Possible Assert.Fail here)
}
catch (SomeException e)
{
Assert.AreEqual("...", e.SomeProperty);
throw e; // perhaps
}
```

But this would violate the no-try-catch-rule. I need some mechanism to make the pattern above acceptable.