Generators
Last updated
Was this helpful?
Last updated
Was this helpful?
Often, we need to create some test data that we will use in multiple tests, like a test user, or we need to create multiple test users and keep track so that we can dispose of them once tests are complete.
This is why we use generators to keep track of all created entities in a list, maybe keep track of last created object, and in similar situations where we can iterate through that list and eventually dispose of created objects.
We use generators in for different tests, where we can create test data in method, and dispose of this test data in method when all tests finish executing.
Here is a snippet of how UserGenerator
is used in UserSetupFixture