Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- METHOD configuration_exception.
- DATA: lo_currency_converter_double TYPE REF TO if_td_currency_converter,
- lo_expense_manager TYPE REF TO cl_td_expense_manager,
- lv_exp_total_expense TYPE i,
- lo_exception TYPE REF TO cx_td_currency_exception.
- FIELD-SYMBOLS: <lv_value> TYPE string.
- *create test double object
- lo_currency_converter_double ?= cl_abap_testdouble=>create( ‘if_td_currency_converter’ ).
- “instantiate the exception object
- CREATE OBJECT lo_exception.
- *configuration for exception. The specified exception gets raised if amount = -1, source_currency = USD “and target_currency = ‘EUR’
- cl_abap_testdouble=>configure_call( lo_currency_converter_double )->raise_exception( lo_exception ).
- lo_currency_converter_double->convert(
- EXPORTING
- amount = -1
- source_currency = ‘USD’
- target_currency = ‘EUR’
- ).
- ENDMETHOD.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement