I use NUnit integration tests.
I am trying to test to make sure that user can’t create account with existing email. (test@example.com)
I need to have test data in the database (account with test@example.com email).
I can create this account in the test function, or in the sql script (and run it before integration tests).
Where is the better place to create this test data?
Neither option is wrong but there are a number of ways to extend and solidify your strategy:
None of these solutions are mutually exclusive. I would recommend the last item especially (pluggable provider) and then a choice between object mocking or faux but quality db test data.