Adding tests for state machine behavior