We're having a bit of a discussion in the office about how to implement good integration tests.
Example:
Account Creation
1. Create User
2. Add Role
One case we test is, if there is already a user with the same email address. For this, I first created a user (programmatically ) and then tried to create an account with the same email.
Now the argument was, that I should be just seed our DB with this existing user and ONLY try to create an account (not have the first CreateUser in the test). Since like this I also implicitly test the "CreateUser" part and it adds functionality to the test that is not necessary, which could lead the test to fail for the wrong reasons.
My point was that it's easier to create the user programmatically and that the CreateUser function is already tested elsewhere. And this way you have all data contained in this one test case, so it's easier to understand.
What do you guys think about this?