I have a relatively large web api application, i.e. it currently has ~300 tables.
The app is written in such a way that it doesn't use any stored procedures and next to no views, i.e. the business logic is all in the app code. It uses the repository pattern so it is relatively easy to create mock data for our unit tests.
However, it is quite hard to manage the mock data, and very hard for any given individual to get insight into what data is already there. We've tried to move the test data into a mock factory, so that it is stored in a single file, which various tests then load as needed (i.e. a given test will only require a certain subset of the data, so it will only ask for that subset).
Still, the management of the data is quite complex, asserting about the data returned from the application is also fragile. For instance, say that there are defined 10 customers in our mock data, out of which 2 are marked as inactive. We may have a test case which tests that a method which should return all active customers should return 8 instances. However, if a developer must add a new instance to our test data, this will break existing tests/asserts.
Does anyone have experience in managing this, or has anything been written about this?