Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 2330

A unit test is code that is written and executed to test a specific portion/unit of source code. Unit tests are class methods with the testMethod modifier or @isTest annotation and are usually placed in separate test classes annotated with the @isTest annotation. Code that is executed by unit tests is considered covered. At least 75% of an organization's codebase must be covered by unit tests and every trigger must have at least 1% unit test coverage.

4
votes
1answer
Suppose I have test class TestClassName with two test methods: @isTest private class TestClassName { static testMethod void testMethodName() { // DML to insert data } static tes …
asked Feb 14 '13 by ipavlic
1
vote
1answer
I'd like to increase my test coverage from 73% to 75% for Production. I am now increasing coverage on classes in Sandbox. I know how large are those classes without comments from Apex Classes page. I …
asked Feb 15 '13 by ipavlic
15
votes
4answers
Can Document folders be created in unit tests? If not, is there a simple workaround for testing Document objects in unit tests?
asked Jun 4 '13 by ipavlic
13
votes
I'm using the following code as a workaround: Document document = new Document(); document.AuthorId = UserInfo.getUserId(); document.FolderId = UserInfo.getUserId();
answered Jun 4 '13 by ipavlic
11
votes
4answers
Can I create an Email Template as part of the unit test? If yes, how?
asked Jun 4 '13 by ipavlic
14
votes
2answers
Suppose I have a test class TestClassName. @isTest private class TestClassName { static testMethod void testMethodName() { System.debug('My debug statement'); System.assertEquals(1, 1 …
asked Feb 14 '13 by ipavlic
2
votes
1answer
Given a custom controller that uses a record selected by a standard controller (not through id parameter), how can I ensure that the appropriate Custom_Field__c field is available in the unit test? O …
asked Nov 6 '14 by ipavlic
0
votes
When you are providing an object to the standard controller, you are responsible for selecting the appropriate record and its fields instead of the standard controller. In a test, that would look like …
answered Nov 6 '14 by ipavlic