Refactor tests

Use a `for` loop instead of repetitively listing out function calls.