Refactor course tests