ADT fallback: Accept headers for FUNC; G0189 accepted; regen2 results
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
@@ -1,152 +0,0 @@
|
||||
CLASS {{p}}duty_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS call
|
||||
IMPORTING
|
||||
iv_value TYPE decfloat34
|
||||
iv_country TYPE string
|
||||
iv_category TYPE string
|
||||
EXPORTING
|
||||
ev_rate TYPE decfloat34
|
||||
ev_duty TYPE decfloat34
|
||||
ev_subrc TYPE sysubrc.
|
||||
METHODS food_rate FOR TESTING.
|
||||
METHODS textile_rate FOR TESTING.
|
||||
METHODS machine_rate FOR TESTING.
|
||||
METHODS unknown_category FOR TESTING.
|
||||
METHODS rounds_half_up FOR TESTING.
|
||||
METHODS minimum_duty FOR TESTING.
|
||||
METHODS zero_value FOR TESTING.
|
||||
METHODS pref_no_minimum FOR TESTING.
|
||||
METHODS pref_ch_de FOR TESTING.
|
||||
METHODS pref_fr_it_es FOR TESTING.
|
||||
METHODS negative_value FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}duty_hidden IMPLEMENTATION.
|
||||
METHOD call.
|
||||
CALL FUNCTION '{{P}}CUSTOMS_DUTY_OLD'
|
||||
EXPORTING
|
||||
iv_value = iv_value
|
||||
iv_country = iv_country
|
||||
iv_category = iv_category
|
||||
IMPORTING
|
||||
ev_rate = ev_rate
|
||||
ev_duty = ev_duty
|
||||
EXCEPTIONS
|
||||
invalid_value = 1
|
||||
OTHERS = 2.
|
||||
ev_subrc = sy-subrc.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD food_rate.
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
DATA lv_duty TYPE decfloat34.
|
||||
call( EXPORTING iv_value = 1000 iv_country = 'US' iv_category = 'FOOD'
|
||||
IMPORTING ev_rate = lv_rate ev_duty = lv_duty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 5 ) act = lv_rate ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 50 ) act = lv_duty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD textile_rate.
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
DATA lv_duty TYPE decfloat34.
|
||||
call( EXPORTING iv_value = '250.50' iv_country = 'US' iv_category = 'TEXTILE'
|
||||
IMPORTING ev_rate = lv_rate ev_duty = lv_duty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 12 ) act = lv_rate ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '30.06' ) act = lv_duty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD machine_rate.
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
DATA lv_duty TYPE decfloat34.
|
||||
call( EXPORTING iv_value = 2000 iv_country = 'US' iv_category = 'MACHINE'
|
||||
IMPORTING ev_rate = lv_rate ev_duty = lv_duty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 3 ) act = lv_rate ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 60 ) act = lv_duty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD unknown_category.
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
DATA lv_duty TYPE decfloat34.
|
||||
call( EXPORTING iv_value = 1000 iv_country = 'US' iv_category = 'TOY'
|
||||
IMPORTING ev_rate = lv_rate ev_duty = lv_duty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_rate ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_duty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rounds_half_up.
|
||||
DATA lv_duty TYPE decfloat34.
|
||||
call( EXPORTING iv_value = '123.7' iv_country = 'US' iv_category = 'FOOD'
|
||||
IMPORTING ev_duty = lv_duty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '6.19' ) act = lv_duty ).
|
||||
|
||||
call( EXPORTING iv_value = '123.45' iv_country = 'US' iv_category = 'FOOD'
|
||||
IMPORTING ev_duty = lv_duty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '6.17' ) act = lv_duty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD minimum_duty.
|
||||
DATA lv_duty TYPE decfloat34.
|
||||
call( EXPORTING iv_value = 50 iv_country = 'US' iv_category = 'FOOD'
|
||||
IMPORTING ev_duty = lv_duty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 5 ) act = lv_duty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD zero_value.
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
DATA lv_duty TYPE decfloat34.
|
||||
DATA lv_subrc TYPE sysubrc.
|
||||
call( EXPORTING iv_value = 0 iv_country = 'US' iv_category = 'FOOD'
|
||||
IMPORTING ev_rate = lv_rate ev_duty = lv_duty ev_subrc = lv_subrc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = lv_subrc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 5 ) act = lv_rate ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_duty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD pref_no_minimum.
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
DATA lv_duty TYPE decfloat34.
|
||||
call( EXPORTING iv_value = 10000 iv_country = 'CH' iv_category = 'TEXTILE'
|
||||
IMPORTING ev_rate = lv_rate ev_duty = lv_duty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_rate ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_duty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD pref_ch_de.
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
DATA lv_duty TYPE decfloat34.
|
||||
call( EXPORTING iv_value = 10000 iv_country = 'DE' iv_category = 'MACHINE'
|
||||
IMPORTING ev_rate = lv_rate ev_duty = lv_duty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_rate ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_duty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD pref_fr_it_es.
|
||||
DATA lv_rate TYPE decfloat34.
|
||||
DATA lv_duty TYPE decfloat34.
|
||||
call( EXPORTING iv_value = 10000 iv_country = 'FR' iv_category = 'FOOD'
|
||||
IMPORTING ev_rate = lv_rate ev_duty = lv_duty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_rate ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_duty ).
|
||||
|
||||
call( EXPORTING iv_value = 10000 iv_country = 'IT' iv_category = 'FOOD'
|
||||
IMPORTING ev_rate = lv_rate ev_duty = lv_duty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_rate ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_duty ).
|
||||
|
||||
call( EXPORTING iv_value = 10000 iv_country = 'ES' iv_category = 'FOOD'
|
||||
IMPORTING ev_rate = lv_rate ev_duty = lv_duty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_rate ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_duty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD negative_value.
|
||||
DATA lv_duty TYPE decfloat34.
|
||||
DATA lv_subrc TYPE sysubrc.
|
||||
call( EXPORTING iv_value = -100 iv_country = 'US' iv_category = 'FOOD'
|
||||
IMPORTING ev_duty = lv_duty ev_subrc = lv_subrc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_subrc ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
127
tasks_gen/eval/G0189/hidden/theme_hidden.clas.abap
Normal file
127
tasks_gen/eval/G0189/hidden/theme_hidden.clas.abap
Normal file
@@ -0,0 +1,127 @@
|
||||
CLASS {{p}}theme_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS call
|
||||
IMPORTING
|
||||
iv_type TYPE string
|
||||
iv_tickets TYPE i
|
||||
iv_date TYPE d
|
||||
EXPORTING
|
||||
ev_unit TYPE decfloat34
|
||||
ev_total TYPE decfloat34
|
||||
ev_discount TYPE decfloat34
|
||||
ev_subrc TYPE sysubrc.
|
||||
METHODS peak_season_surcharge FOR TESTING.
|
||||
METHODS no_surcharge_off_peak FOR TESTING.
|
||||
METHODS discount_tiers FOR TESTING.
|
||||
METHODS discount_rounding FOR TESTING.
|
||||
METHODS base_prices FOR TESTING.
|
||||
METHODS invalid_visitor_type FOR TESTING.
|
||||
METHODS invalid_tickets FOR TESTING.
|
||||
METHODS unit_price_with_surcharge FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}theme_hidden IMPLEMENTATION.
|
||||
METHOD call.
|
||||
CALL FUNCTION '{{P}}THEME_FEE'
|
||||
EXPORTING
|
||||
iv_visitor_type = iv_type
|
||||
iv_tickets = iv_tickets
|
||||
iv_date = iv_date
|
||||
IMPORTING
|
||||
ev_unit_price = ev_unit
|
||||
ev_total_price = ev_total
|
||||
ev_discount = ev_discount
|
||||
EXCEPTIONS
|
||||
invalid_visitor_type = 1
|
||||
invalid_tickets = 2
|
||||
OTHERS = 3.
|
||||
ev_subrc = sy-subrc.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD peak_season_surcharge.
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = 1 iv_date = '20250715'
|
||||
IMPORTING ev_unit = DATA(lv_jul) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '50.50' ) act = lv_jul ).
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = 1 iv_date = '20250801'
|
||||
IMPORTING ev_unit = DATA(lv_aug) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '50.50' ) act = lv_aug ).
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = 1 iv_date = '20250630'
|
||||
IMPORTING ev_unit = DATA(lv_jun) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '50.50' ) act = lv_jun ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD no_surcharge_off_peak.
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = 1 iv_date = '20250115'
|
||||
IMPORTING ev_unit = DATA(lv_jan) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '45.50' ) act = lv_jan ).
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = 1 iv_date = '20251215'
|
||||
IMPORTING ev_unit = DATA(lv_dec) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '45.50' ) act = lv_dec ).
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = 1 iv_date = '20250531'
|
||||
IMPORTING ev_unit = DATA(lv_may) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '45.50' ) act = lv_may ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD discount_tiers.
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = 9 iv_date = '20250115'
|
||||
IMPORTING ev_discount = DATA(lv_d9) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_d9 ).
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = 10 iv_date = '20250115'
|
||||
IMPORTING ev_discount = DATA(lv_d10) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '45.50' ) act = lv_d10 ).
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = 19 iv_date = '20250115'
|
||||
IMPORTING ev_discount = DATA(lv_d19) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '86.45' ) act = lv_d19 ).
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = 20 iv_date = '20250115'
|
||||
IMPORTING ev_discount = DATA(lv_d20) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '136.50' ) act = lv_d20 ).
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = 25 iv_date = '20250115'
|
||||
IMPORTING ev_discount = DATA(lv_d25) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '170.63' ) act = lv_d25 ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD discount_rounding.
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = 25 iv_date = '20250115'
|
||||
IMPORTING ev_discount = DATA(lv_disc) ev_total = DATA(lv_total) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '170.63' ) act = lv_disc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '966.87' ) act = lv_total ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD base_prices.
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = 1 iv_date = '20250115'
|
||||
IMPORTING ev_unit = DATA(lv_adult) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '45.50' ) act = lv_adult ).
|
||||
call( EXPORTING iv_type = 'CHILD' iv_tickets = 1 iv_date = '20250115'
|
||||
IMPORTING ev_unit = DATA(lv_child) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '25.25' ) act = lv_child ).
|
||||
call( EXPORTING iv_type = 'SENIOR' iv_tickets = 1 iv_date = '20250115'
|
||||
IMPORTING ev_unit = DATA(lv_senior) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '30.75' ) act = lv_senior ).
|
||||
call( EXPORTING iv_type = 'FAMILY' iv_tickets = 1 iv_date = '20250115'
|
||||
IMPORTING ev_unit = DATA(lv_family) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '40.00' ) act = lv_family ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD invalid_visitor_type.
|
||||
call( EXPORTING iv_type = 'STUDENT' iv_tickets = 1 iv_date = '20250115'
|
||||
IMPORTING ev_subrc = DATA(lv_rc) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD invalid_tickets.
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = 0 iv_date = '20250115'
|
||||
IMPORTING ev_subrc = DATA(lv_rc0) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_rc0 ).
|
||||
call( EXPORTING iv_type = 'ADULT' iv_tickets = -1 iv_date = '20250115'
|
||||
IMPORTING ev_subrc = DATA(lv_rc1) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 2 act = lv_rc1 ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD unit_price_with_surcharge.
|
||||
call( EXPORTING iv_type = 'CHILD' iv_tickets = 1 iv_date = '20250704'
|
||||
IMPORTING ev_unit = DATA(lv_unit) ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '30.25' ) act = lv_unit ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user