Error message validation in InvalidStateError test