Skip to content

Latest commit

 

History

History
74 lines (52 loc) · 2.06 KB

AlignMethodsForTestingRule.md

File metadata and controls

74 lines (52 loc) · 2.06 KB

<-- previous rule | overview | next rule -->

Align METHODS ... FOR TESTING

Aligns consecutive METHODS ... FOR TESTING declarations.

Activate this rule if you want to override the result of 'Align METHODS declarations' with special settings.

Options

  • Continue line after METHODS [always]
  • Continue line after method name [always]
  • Align across empty lines
  • Align across comment lines

Examples

  " comment on first group of test methods
  METHODS test_setup
    FOR TESTING.
  METHODS test_functionality
    FOR TESTING.
  METHODS test_display
    FOR TESTING.

  " comment on second group of test methods
  METHODS any_test_method_name
    FOR TESTING RAISING cx_static_check.
  METHODS other_test_method_name
    FOR TESTING RAISING cx_static_check.

  METHODS test_invalid_input
    FOR TESTING.

  " chains are aligned independently:
  METHODS:
    first_test_method
      FOR TESTING,
    second_test_method
      FOR TESTING RAISING cx_message,
    last_test_method
      FOR TESTING.

Resulting code:

  " comment on first group of test methods
  METHODS test_setup             FOR TESTING.
  METHODS test_functionality     FOR TESTING.
  METHODS test_display           FOR TESTING.

  " comment on second group of test methods
  METHODS any_test_method_name   FOR TESTING RAISING cx_static_check.
  METHODS other_test_method_name FOR TESTING RAISING cx_static_check.

  METHODS test_invalid_input     FOR TESTING.

  " chains are aligned independently:
  METHODS: first_test_method  FOR TESTING,
           second_test_method FOR TESTING RAISING cx_message,
           last_test_method   FOR TESTING.

Related code