Skip to main content

Hi All,

I encountered this issue and attempted all recommended solutions, but they were unsuccessful.

Please review and advise.

Thanks.

 

Challenges:

 

https://trailhead.salesforce.com/content/learn/modules/platform-developer-i-certification-maintenance-winter-25/get-hands-on-with-iterable-variable-in-for-loops?trail_id=maintain-your-salesforce-certifications

 

@isTest

 

public class MyIterableTest {

    @isTest

 

    private static void testIterableForLoop() {

        Test.startTest();

 

        List<String> strings = new List<String> {'Hello', 'World'};

 

        MyIterable myIterable = new MyIterable(strings);

 

        for (String str : myIterable) {

 

            System.debug(str);

 

        }

        Test.stopTest();

 

    }

 

}

 

#Trailhead Challenges

7 answers
0/9000