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

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

Sabra
13 days ago
I'm stumped, but I'm going to go with D. Logging the failure seems like the most logical outcome. Although, I do wonder if the test object's name is a subtle clue...
upvoted 0 times
Bettina
22 hours ago
A) The tested unit will automatically be appended to a default ABAP Test Cockpit Variant.
upvoted 0 times
...
...
Launa
19 days ago
So, we all agree that the test will be aborted if the method parameters act and exp are not equal.
upvoted 0 times
...
Nancey
21 days ago
That makes sense, Tresa. If the assertion fails, the test should be aborted.
upvoted 0 times
...
Alpha
22 days ago
Haha, I bet the developer who wrote this test has a great sense of humor. 'Risk level HARMLESS, duration SHORT' - that's the kind of quality assurance I can get behind!
upvoted 0 times
...
Tresa
23 days ago
I believe the correct answer is C) The test will be aborted because the assertion will fail.
upvoted 0 times
...
Lindsey
28 days ago
D seems right to me. The test log is where you'd want to see the details if something goes wrong with the assert. Doesn't make much sense to just silently fail or add it to some variant.
upvoted 0 times
Florinda
16 days ago
D seems right to me. The test log is where you'd want to see the details if something goes wrong with the assert. Doesn't make much sense to just silently fail or add it to some variant.
upvoted 0 times
...
Thaddeus
18 days ago
Definitely, having that message helps in debugging and understanding what went wrong during the test.
upvoted 0 times
...
Layla
20 days ago
Yes, I agree. It's important to have a clear message in the test log when there's a failure.
upvoted 0 times
...
Karl
22 days ago
D seems right to me. The test log is where you'd want to see the details if something goes wrong with the assert. Doesn't make much sense to just silently fail or add it to some variant.
upvoted 0 times
...
...
Launa
1 months ago
I agree with you, Nancey. The test will definitely be aborted if the parameters are not equal.
upvoted 0 times
...
Nancey
1 months ago
I think if the method parameters act and exp are not equal, the test will be aborted.
upvoted 0 times
...
Loren
1 months ago
I'm going with C. If the assert fails, the test should just stop right there. No need to keep going if the input and expected output don't line up.
upvoted 0 times
Katina
14 days ago
Absolutely, it helps in identifying the issue quickly and prevents further incorrect test results.
upvoted 0 times
...
Sherell
19 days ago
That makes sense. It's important to stop the test if the expected and actual values don't match.
upvoted 0 times
...
Cassi
22 days ago
Yes, you're right. If the assert fails, the test will be aborted.
upvoted 0 times
...
Page
23 days ago
I'm going with C. If the assert fails, the test should just stop right there. No need to keep going if the input and expected output don't line up.
upvoted 0 times
...
...
Glory
2 months ago
The correct answer is clearly D. The test will log a message if the assert_equals method parameters don't match. That's the whole point of using it in the first place.
upvoted 0 times
Ronnie
25 days ago
B) The tested unit cannot be transported.
upvoted 0 times
...
Sheldon
27 days ago
A) The tested unit will automatically be appended to a default ABAP Test Cockpit Variant.
upvoted 0 times
...
Loreta
29 days ago
B) The tested unit cannot be transported.
upvoted 0 times
...
Domonique
1 months ago
A) The tested unit will automatically be appended to a default ABAP Test Cockpit Variant.
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