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 34 Discussion

Actual exam question for SAP's C_ABAPD_2309 exam
Question #: 34
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:

Elden
2 days ago
This question is a piece of cake! D) There will be a message in the test log. Of course, that's what happens when an assertion fails - it gets logged for you to review.
upvoted 0 times
...
Reita
8 days ago
A) The tested unit will automatically be appended to a default ABAP Test Cockpit Variant. Hmm, I'm not sure about this one, but it sounds like a reasonable consequence of a failed test.
upvoted 0 times
...
Nieves
13 days ago
Yes, I remember reading that in the documentation. So, the correct answer is C) The test will be aborted.
upvoted 0 times
...
Lewis
22 days ago
D) There will be a message in the test log. The question clearly states that a message will be generated if the assert fails, so this has to be the correct answer.
upvoted 0 times
Ahmad
7 days ago
A) The tested unit will automatically be appended to a default ABAP Test Cockpit Variant.
upvoted 0 times
...
...
Delpha
26 days ago
I agree with you, Rosio. The test will definitely be aborted if the parameters are not equal.
upvoted 0 times
...
Rosio
28 days ago
I think if the method parameters act and exp are not equal, the test will be aborted.
upvoted 0 times
...
Lillian
1 months ago
C) The test will be aborted. That's the obvious answer. If the actual and expected values don't match, the test has to fail, right?
upvoted 0 times
Georgiana
14 days ago
C) The test will be aborted.
upvoted 0 times
...
Pedro
15 days ago
B) The tested unit cannot be transported.
upvoted 0 times
...
Lynda
16 days ago
A) The tested unit will automatically be appended to a default ABAP Test Cockpit Variant.
upvoted 0 times
...
...

Save Cancel