3

You're most of the way there, and I think you have all of the code you need, but there's a couple of key misconceptions here that are holding you back. Let's start here: Test.startTest(); String moodleIdNull = MoodleApiLoaderController.getCoursePortalId(null); //also test '' String moodleIdExists = MoodleApiLoaderController.getCoursePortalId('...


3

So far you can't. The only thing you can run is Apex Classes compilation with the --apexcompile flag. However, starting Winter 21, code coverage should be enforced for Unlocked Packages installation. The original post from PM Dileep Burki is available here, feel free to go there and give your thoughts about it. Enforcement of Code Coverage in Unlocked ...


2

There are several issues here. Logic first: List<String> result = PickListController.getPickListValuesIntoList('Contact', testContact[0].Rol__c); testContact[0].Rol__c is a reference to the content of the Rol__c field, as a string, not the name of the Rol__c field itself. It's passed into getPickListValuesIntoList() as the parameter selectedField,...


2

Your unit test needs to call the method: @isTest static void testScheduleMe() { Test.startTest(); ContUpdateScheduler.scheduleMe(); Test.stopTest(); } Coincidentally, this will cover the execute method as well.


2

First, I would recommend that If you are passing an Id to a method, you use the Id type, not the String type. :) Second, never pass a hardcoded Id to a method... that's just asking for trouble. Third, you may want to either try-catch the select query or to cast into a List in case the Id does not exist. It is significantly safer. Having said that, here is ...


1

Let's break this down a little here: 1: first you should be checking if you even supplied a non-null object for entitlementRec Map<String,Object> mapObj = (Map<String,Object>)Json.deserializeUntyped(Json.serialize(entitlementRec)); 2: then you should be checking if you even have a mapObj and if you even have the keys for fields before you ...


1

So it doesn't appear that you're even testing your class. It only appears that you are testing the trigger, kind of, but never actually testing the class. To properly test your class, you should create an instance of your class, call the methods, assert the results of your methods. So while your test method is "passing" it's not testing anything. You're only ...


1

Within your test, careerdetails.obj is not set the way you intended. The Id string careerId is empty, as your test class does not set the URL-parameter. Your way of filling obj can be optimized - that is, if I understand your objective correctly. In obj = (Career__c)stdController.getRecord(); you get the record that is correctly set from your test class....


1

Received the following knowledge article from Support During deployments we do not run mixed DML operation checks, whereas via the UI we do (either 'Run All Tests' or running a test for an individual class). If the differences between the test failures seen in the UI compared to the deployment is solely down to 'MIXED_DML_OPERATION' errors, then this can ...


Only top voted, non community-wiki answers of a minimum length are eligible