added test cases for switch