Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

SAP Exam C_ABAPD_2309 Topic 1 Question 16 Discussion

Actual exam question for SAP's C_ABAPD_2309 exam
Question #: 16
Topic #: 1
[All C_ABAPD_2309 Questions]

In a test method you call method cl_abap_unit_assert=>assert_equals( .. ) in the following way:

CLASS Itcl1 DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.

PRIVATE SECTION.

METHODS m1 FOR TESTING.

ENDCLASS.

CLASS Itcl1 IMPLEMENTATION.

METHOD m1.

DATA: go_test_object TYPE REF TO zcl_to_be_tested.

CONSTANTS: Ico_exp TYPE string VALUE 'test2'.

CREATE OBJECT go_test_object.

cl_abap_unit_assert=>assert_equals(

EXPORTING

act = go_class->mv_attribute

exp = lco_exp

msg = 'assert equals failed ' && go_test_object->mv_attribute && ' ' && lco_exp

ENDMETHOD.

ENDCLASS.

What will happen if method parameters act and exp are not equal?

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Georgeanna
4 months ago
B) The tested unit cannot be transported. Nah, the assert_equals method has nothing to do with transportation. These options are getting a bit silly now.
upvoted 0 times
Cordelia
3 months ago
User 2: I agree, these options are not very relevant to the question.
upvoted 0 times
...
Nu
4 months ago
User 1: Yeah, you're right. The assert_equals method is for testing, not transportation.
upvoted 0 times
...
...
Sanda
5 months ago
A) The tested unit will automatically be appended to a default ABAP Test Cockpit Variant. Hmm, I don't think that's how the assert_equals method works. Sounds more like a feature of the ABAP Test Cockpit itself.
upvoted 0 times
Scot
4 months ago
D) There will be a message in the test log.
upvoted 0 times
...
Nu
4 months ago
C) The test will be aborted.
upvoted 0 times
...
Alline
4 months ago
C) The test will be aborted.
upvoted 0 times
...
Melina
4 months ago
C) The test will be aborted.
upvoted 0 times
...
Virgilio
4 months ago
B) The tested unit cannot be transported.
upvoted 0 times
...
Sharika
4 months ago
A) The tested unit will automatically be appended to a default ABAP Test Cockpit Variant.
upvoted 0 times
...
Isidra
5 months ago
A) The tested unit will automatically be appended to a default ABAP Test Cockpit Variant.
upvoted 0 times
...
...
Buddy
5 months ago
D) There will be a message in the test log. While this is also correct, it doesn't fully capture the behavior of the assert_equals method, which will actually abort the test on failure.
upvoted 0 times
Kristeen
5 months ago
D) There will be a message in the test log.
upvoted 0 times
...
Eladia
5 months ago
C) The test will be aborted.
upvoted 0 times
...
Melvin
5 months ago
D) There will be a message in the test log.
upvoted 0 times
...
Jeanice
5 months ago
C) The test will be aborted.
upvoted 0 times
...
...
Garry
6 months ago
C) The test will be aborted. This is the correct answer, as the assert_equals method will throw an exception if the actual and expected values are not equal, causing the test to fail and be aborted.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77