basic fsm with unit test