ABAP Test Double Framework

https://blogs.sap.com/2015/01/05/abap-test-double-framework-an-introduction/

1: 创建接口ZIF_TD_CURRENCY_CONVER

 2:添加,事件和方法

interface ZIF_TD_CURRENCY_CONVER
  public .
   EVENTS new_currency_code EXPORTING VALUE(currency_code) TYPE string.

  METHODS convert
    IMPORTING
              amount          TYPE i
              source_currency TYPE string
              target_currency TYPE string
    RETURNING VALUE(result)  TYPE i
    RAISING  cx_td_currency_exception.

  METHODS convert_to_base_currency
    IMPORTING
      amount          TYPE i
      source_currency  TYPE string
    EXPORTING
      base_currency    TYPE string
      base_curr_amount TYPE i.

endinterface.

3:创建一个类

 为该类创建测试类

猜你喜欢

转载自www.cnblogs.com/liyafei/p/11443371.html