Whenever I read a test method I want to understand it without having to jump around in the test class (or worse, in dependencies).
As an example, here is a test I encountered recently: The way I read this: So while trying to understand this test that last line surprised me.
This method populates the database with some user data that is used in various ways by one of the test methods in the class. There are some problems with this approach: The first thing we need to do is ensure that each test only creates the database records that it really needs, e.g.
There's only that 'alicepassword' string that is irrelevant for this test.