Tests for the StateMachine class