ABAP Test Double Framework

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

1: 创建接口ZIF_TD_CURRENCY_CONVER

ABAP Test Double Framework

 

 

 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:创建一个类

ABAP Test Double Framework

 

 为该类创建测试类

ABAP Test Double Framework

 

上一篇:java – 使用模式格式化货币时是否使用正确的数字分隔符?


下一篇:java – 从String转换为BigDecimal以对货币进行数学运算