Test that a document count of zero throws the approriate error