Factor the test to be cleaner