Simple Unit Test using Global Class
Below is the class with a method for which we want to do a unit test.
Create a new class and go to the methods tab.
Select the local test classes.
Here we can have local test class and use the SERVICE class CL_AUNIT_ASSERT to check the expected value with actual value.
Here we can do a unit test from the menu path as shown.
The test is successful.
Let’s change the carrid value to check the unit test result.
So here is the unit test result displayed.
Also after coming out of the local test classed, from the shown menu path, unit test can be performed.
Here is the unit test and its result.