add unit test for statemachine