Switch case implemented with test cases