Skip to content

Commit

Permalink
example of abap code ok
Browse files Browse the repository at this point in the history
  • Loading branch information
simonegaffurini committed Jul 5, 2024
1 parent d95e915 commit 7606412
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions src/zcl_sampletrmactions.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,29 @@ CLASS zcl_sampletrmactions DEFINITION
FINAL
CREATE PUBLIC .

PUBLIC SECTION.
PUBLIC SECTION.

METHODS constructor.
METHODS constructor.

METHODS sum
METHODS sum
IMPORTING iv_val1 TYPE i
iv_val2 TYPE i
RETURNING VALUE(rv_result) TYPE i.

PROTECTED SECTION.
PRIVATE SECTION.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.



CLASS ZCL_SAMPLETRMACTIONS IMPLEMENTATION.


METHOD constructor.
" empty
ENDMETHOD.


METHOD sum.
rv_result = iv_val1 + iv_val2 . " abapLint will tell us something is wrong with this line (space_before_dot)
rv_result = iv_val1 + iv_val2.
ENDMETHOD.

ENDCLASS.
2 changes: 1 addition & 1 deletion src/zcl_sampletrmactions.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CLASS lcl_test IMPLEMENTATION.
cl_abap_unit_assert=>assert_equals( msg = 'Error in result 1 + 1'
exp = m_cut->sum( iv_val1 = 1
iv_val2 = 1 )
act = 1 ). " ADASH will tell us this unit test is broken
act = 2 ).
ENDMETHOD.

ENDCLASS.

0 comments on commit 7606412

Please sign in to comment.