Q:

unit testing an unexcpected exception?

Is it possible to mock or unit test for an unexpected exception? Code coverage is complaining that the catch is not being tested for, but how do you test it? 
    public List<Blog> SelectActiveBlogs()
    {
        List<Blog> returnCode = null;

        try
        {
            returnCode = GetQueryable<Blog>().Where(b => b.IsActive).ToList();
        }
        catch (Exception ex)
        {
            ExceptionHandler.HandleException(ex);
        }

        return returnCode;
    }

EDIT: The GetQueryable is a method that uses a repository factory to get a db result, so there could be exceptions bubbling up from db interactions in production, so I want to make sure we catch them if something goes wrong an thus the catch block is present.
EDIT2: The exception is actually handled by a custom class to preserve the stack trace, once logged it's not re thrown. Question still remains as to whether I can mock and throw an exception in this case.

A:

Don't mock the method GetQueryable() but the class that is is responsible to get the queryable.
I guess you have some code like this in GetQueryable()
private IQueryable<T> GetQueryable<T>()
{
     return repository.query...
}

So don't try to mock the method but the repository instance and throw an exception in the mock when query is called.
Mocking that using MoQ should not be to complicated - something like
var mock = new Moq.Mock<IRepository<Blog>>();
mock.Setup(r => r.Query()).Throws(new Exception("I'm really unexpected"));

I'm in doubt if this test will lead to a greater code quality or less bugs. But the above method will please the coverage tool ;) 

