ABAP单元帮助类的两种使用方式

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/i042416/article/details/88026411

来自我的同事Mervin

Two way to do the unit test:

1. Using test class

Create a Test class in my local object in AG3/001

clipboard1

chose the Test Class.
When you click OK. the Class will be generated automatically.

clipboard2

Define My test method.
clipboard3

Implement the method.
clipboard4

2. Using Local test class

Copy the product class cl_crm_uiu_prod_cust_get to my local class ZCL_CRM_UIU_PROD_CUST_GET.

clipboard5

clipboard6

Generate the local test class for class ZCL_CRM_UIU_PROD_CUST_GET.
clipboard7

And chose the method you need to do the unit test. In this example, I chose the method get_Values_For_Field. The unit test method will be generated like below:

clipboard8

Note: When you active the local class, there is error about the include. Just ignore it And active.
Implement the method get_Values_For_Field in local class.
clipboard9

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

猜你喜欢

转载自blog.csdn.net/i042416/article/details/88026411