Introduction to Test Classes in Salesforce
1h 27mBeginner2019-04-24
Authors

Duard Lynn Davis
Expert in Salesforce development
Course details
The ability to write test code is a valuable skill for any developer who customizes the Salesforce platform for their organization. In this course, join instructor Duard Lynn Davis as he shows why test classes are needed, how to write them for supportability, and how to achieve maximum code coverage. Learn how to create a basic test class, implement test code using test factory methods, and address common concerns with test classes, including how to use asserts to validate that your code is performing as expected. Plus, explore more advanced testing topics, such as how to test each aspect of batch Apex code.
Learning objectives
The value of writing proper test code
Setting up and customizing a test factory
Using the test factory to create test code
Best practices for writing test code
Adding system asserts into test code
Advantages of custom metadata
Writing test classes for batch Apex and @future
Learning objectives
The value of writing proper test code
Setting up and customizing a test factory
Using the test factory to create test code
Best practices for writing test code
Adding system asserts into test code
Advantages of custom metadata
Writing test classes for batch Apex and @future
Skills covered
CRM AdministrationSalesforce.comSalesforceSoftware TestingIntroduction toNetwork and System AdministrationSoftware Development
Concepts
0. Introduction
- 01 - The power of test classes in Salesforce
- 02 - What you should know
1. The Need for Tests
- 03 - Test class requirements
- 04 - Value of test classes
- 05 - Test-driven development
- 06 - Miscellaneous tests
2. Write Tests
- 07 - Basic test class for Apex code
- 08 - Test data creation and validation
- 09 - Naming convention - Test classes
- 10 - Initial test class modifications
- 11 - Coding example - Test utility
- 12 - Testing using a test factory
- 13 - Set global values for the test factory
- 14 - Set up a test factory
- 15 - Customize a test factory
- 16 - Testing with a test factory
3. Common Concerns with Test Classes
- 17 - Best practices with test class
- 18 - System asserts
- 19 - Static resources
- 20 - Custom settings vs. Custom metadata
- 21 - Profiles and record types
4. Beyond the Basics
- 22 - Advanced testing topics
- 23 - Batch Apex
- 24 - Mock framework
- 25 - Testing @future
- 26 - Testing visual force pages
Conclusion
- 27 - Next steps
Related courses
- Salesforce Sales Foundations Cert Prep
- The Pre-Sales Engineer's Guide to Whiteboarding: Engaging Executives to Close Deals
- Salesforce for Admins
- Learning Zoho CRM
- Salesforce Administrator Cert Prep: 3 Sales, Marketing and Service Applications
- Salesforce Administrator Cert Prep: 4 Collaboration, Data Management and Automation
- Salesforce Administrator Cert Prep: 2 Security and Data Model
- Learning Salesforce.com Development