
A fixture is a test configuration - the set of resources required to perform a test correctly - that is created before a Test Method is called. A fixture may include test data, test objects, and resources.
To create a fixture, you can implement the following private, parameterless methods in a test class; the methods have predefined names and are automatically called by the ABAP runtime environment when the test is executed:
An instance method setup, which is executed before every single test method of the class.
An instance method teardown, which is executed after every single test method of the class.
A static method class_setup, which is executed once before every test of the class.
A static method class_teardown, which is executed once after every test of the class.
All tests that use the same fixture should be included in a single test class, so that they can share the same setup and tear down.
The fixture methods always refer to the current class. In test classes that inherit from one another, the fixture methods are executed for each class involved. The setup methods are executed from the superclasses to the subclasses and the teardown methods from the subclasses to the superclasses.