Added test for getEnum(...) method

Hi Anton, what do you think of this implementation? I've added a test as well.. :) 

Could you rebase it into your branch, and then submit a pull request with all of it to me? Let me know if you have trouble with getting the commit in or rebasing, it's always tricky the first couple times.