Added test that verifies the validation logic.