Closed michael-kamel closed 4 years ago
The test suite assumes an empty database and the order is relevant for the tests to function.
getAccountProfile_idExists_success()
will run after an account (with ID 1) was created. But if we now have other tests that create accounts, this system is of course not going to work well.
Ideally each unit test should be isolated, but even then, sometimes postgres creates an id different than 1 even when the database is empty. I think the in-mem database might handle this well though.
okay. so feel free to merge or to add more changes to the tests if you like
I might make changes to the other test as well but I am trying to figure out a way to do so with minimal impact
I don't think there is an easy way to adjust the second test without altering the logic a little bit. I'm opting for keeping it this way, after all, this rarely happens anyway.
the test
getAccountProfile_idExists_success
also has the same issue but it seems like it depends on other tests to function?.The idea is that the IDs are assumed to be 1, but this is not always the case.