3

You're not supposed to duplicate the logic of the thing being tested in the test itself. The test method is supposed to set up the environment to allow your SUT (system under test) to be run, and then gather results so you can make assertions to verify that the output is what you expect. You only gain coverage for code that is executed as part of a test. ...


3

As long as you include LeadHelperTest in the change set (or whichever mechanism you're using for deployment), that is enough.


2

These are compilation errors. The system is telling you that it doesn't understand your code. The line numbers tell you were the problematic code is, although sometimes the actual error occurs in another spot. For example, the "Method does not exist..." errors occur on the two lines that contain importData.import_Raw_Data();, but the actual ...


1

There are couple of things to note here: testMethod keyword is deprecated, you should is @IsTest annotation instead To set up your test data for common methods, try to use @TestSetup annotation in a method that will include your common data before each individual test method execution, just like this: static void createTestDate() { createTestUser(); ...


1

DML operations on certain sObjects, sometimes referred to as setup objects, can’t be mixed with DML on other sObjects in the same transaction. This restriction exists because some sObjects affect the user’s access to records in the org. You must insert or update these types of sObjects in a different transaction to prevent operations from happening with ...


1

In your test method, you can create new records in custom setting, just as will create test data for other standard/custom object. At the beginning of your test method, insert a new record of custom setting (Api will be like: < MyCustomSetting >__c), populate the fields values as per the method you are testing, and it will work. Do not use seeAllData=...


1

There are many, many ways to automate it. You can subscribe to an app like GearSet to schedule automations, you can set up a CI/CD (Continuous Integration/Continuous Delivery) system to run tests on a schedule, you can use the basic core features of Windows or Linux systems to run a Windows Task or Cronjob, deploy a container to Heroku or AWS, etc, or you ...


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