Refactored tests per end of chapter 5 of tutorial