How it works...

The Apex Test Class provides unit test coverage of the Apex Controller class AccountSearchController. In the context of the framework off our "Search First Before You Create" Lightning Component, Apex test classes are required for the following, as described by Salesforce:

Before you can deploy your code, or package it for the Force.com AppExchange, the following must be true. At least 75% of your Apex code must be covered by unit tests, and all of those tests must complete successfully. Note the following:
When deploying Apex to a production organization, each unit test in your organization namespace is executed by default. Calls to System.debug are not counted as part of Apex code coverage. Test methods and test classes are not counted as part of Apex code coverage. While only 75% of your Apex code must be covered by tests, your focus shouldn't be on the percentage of code that is covered. Instead, you should make sure that every use case of your application is covered, including positive and negative cases, as well as bulk and single records. This should lead to 75% or more of your code being covered by unit tests. Every trigger must have some test coverage. All classes and triggers must compile successfully.
Reference: Apex Developer Guide: Understanding Testing in Apex https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_intro.htm
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset