Switches can be evil. In this case, the code has a lot of repetition. Since you have a passing test, you should feel free to refactor this. Try to reduce this switch down so that there is no repetition.