Maybe just generalize this into a mechanism for turning error codes into messages and unit test that mechanism separately.  

It's not the usage of a dictionary I object to so much as the repeated creation of a dictionary to get a single item from it.