State Machine Test