The following mspec test works as expected.
static Exception exception;
private Because of = () =>
exception = Catch.Exception( () => throw new NotFoundException("test"));
It should_throw_exception = () =>
exception.ShouldBeOfExactType<NotFoundException>();
However, the following code fails the test because exception is null?
private Because of = () =>
exception = Catch.Exception(async () => throw new NotFoundException("test"));
I couldn't get it to work either, so I had to work around it. Rather than use their convenience method for catching exceptions, I used a block and caught the exception myself. This code is working for me: