mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-02 13:03:01 +08:00

* Naming of class constants This is in preparation of enforcing a naming convention for constants in classes/interfaces. At the end, the following lint rule shall be set: ```json "class_attribute_names": { "constants": "^C_.+$", ... }, ``` After this, the only remaining constants not following this rule are in `zcl_abapgit_version`. * Update zif_abapgit_dot_abapgit.intf.abap * Update zcl_abapgit_gui_chunk_lib.clas.abap * Update zcl_abapgit_gui_router.clas.abap Co-authored-by: Lars Hvam <larshp@hotmail.com>
31 lines
819 B
ABAP
31 lines
819 B
ABAP
CLASS ltcl_user_record DEFINITION DEFERRED.
|
|
|
|
CLASS zcl_abapgit_user_record DEFINITION LOCAL FRIENDS ltcl_user_record.
|
|
|
|
CLASS ltcl_user_record DEFINITION FINAL FOR TESTING
|
|
DURATION SHORT
|
|
RISK LEVEL HARMLESS.
|
|
|
|
PRIVATE SECTION.
|
|
CONSTANTS c_wrong_user TYPE sy-uname VALUE 'WRONG_USER'.
|
|
METHODS:
|
|
test_invalid_user FOR TESTING RAISING cx_static_check.
|
|
ENDCLASS.
|
|
|
|
|
|
CLASS ltcl_user_record IMPLEMENTATION.
|
|
|
|
METHOD test_invalid_user.
|
|
DATA: lo_user_record TYPE REF TO zcl_abapgit_user_record.
|
|
|
|
zcl_abapgit_user_record=>reset( ).
|
|
lo_user_record = zcl_abapgit_user_record=>get_instance( c_wrong_user ).
|
|
|
|
cl_abap_unit_assert=>assert_equals(
|
|
exp = 0
|
|
act = lines( zcl_abapgit_user_record=>gt_user )
|
|
msg = |User { c_wrong_user } is missing in the list| ).
|
|
ENDMETHOD.
|
|
|
|
ENDCLASS.
|