add CASE command implementation and test case for it