Refactor tests to use auto-generated field