You need to sign in to do that
Don't have an account?
Unit Testing reset transiant test data.
Hello Devs,
Is there a way to reset all the transiant test data in a unit test class. For instance you tested a few methods of a class, but to test the remaining methods you need/want to start with a clean slate. I want to purge all the fake data in the database.
I know if I keep track of the records I create, I can delete them at the end of a test, but that does not take care of records that are created via triggers, triggers that I am not testing for, and might not be thinking about during this unit.
Thanks!
Is there a way to reset all the transiant test data in a unit test class. For instance you tested a few methods of a class, but to test the remaining methods you need/want to start with a clean slate. I want to purge all the fake data in the database.
I know if I keep track of the records I create, I can delete them at the end of a test, but that does not take care of records that are created via triggers, triggers that I am not testing for, and might not be thinking about during this unit.
Thanks!