From the course: Introduction to Test Classes in Salesforce
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Test data creation and validation - Salesforce Tutorial
From the course: Introduction to Test Classes in Salesforce
Test data creation and validation
- [Speaker] As a developer that's been working on the Salesforce platform of a number of years, one of the questions I typically get asked is why do I use Eclipse, and in particular, why not use one of the other tools that has better user interface, maybe a little bit easier to use? One of the key reasons I use Eclipse is I can use it on any org anywhere and it's a free tool that's provided by Salesforce. In Eclipse, when I create a basic test class, this basic test class is going to come up and look exactly what we're seeing on screen. It has several lines of comments about this being a test class, I personally usually remove those. The important piece here is the @isTest. Any class that starts with @isTest is not going to count against our total number of lines of code. Remember, when Salesforce calculates your code coverage, they take the total number of lines covered by the total number of lines in the org. We don't want our test classes to be counted in the total number of lines.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Basic test class for Apex code2m 56s
-
(Locked)
Test data creation and validation1m 51s
-
(Locked)
Naming convention: Test classes1m 24s
-
(Locked)
Initial test class modifications2m 54s
-
(Locked)
Coding example: Test utility11m 7s
-
(Locked)
Testing using a test factory1m 41s
-
(Locked)
Set global values for the test factory2m 33s
-
(Locked)
Set up a test factory2m 29s
-
(Locked)
Customize a test factory3m 4s
-
Testing with a test factory5m 46s
-
-
-
-