You need to sign in to do that
Don't have an account?
asd@as.asd
Test Class
hello
i am new salesforce.i want to write test class for triggers and controller class.
please help me to write test class
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
hello
i am new salesforce.i want to write test class for triggers and controller class.
please help me to write test class
Please go through this link:
http://th3silverlining.com/2010/02/04/unit-tests-code-coverage-with-the-apex-programming-language/
http://astreait.com/wordpress/?p=58
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
All Answers
Please go through this link:
http://th3silverlining.com/2010/02/04/unit-tests-code-coverage-with-the-apex-programming-language/
http://astreait.com/wordpress/?p=58
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
hello
i am using test,startTest() and test.stopTest() method in test class.
i am facing a error :
Method does not exist or incorrect signature: Test.startTest() at line 16 column 9
my code is :
@isTest
private class testclass{
public static testMethod void TestOverwriteTestAccountDescriptions(){
// Perform our data preparation.
List<Account> accounts = new List<Account>{};
for(Integer i = 0; i < 200; i++){
Account a = new Account(Name = 'Test Account ' + i);
accounts.add(a);
}
// Start the test, this changes governor limit context to
// that of trigger rather than test.
Test.startTest();
// Insert the Account records that cause the trigger to execute.
insert accounts;
// Stop the test, this changes limit context back to test from trigger.
Test.stopTest();
// Query the database for the newly inserted records.
List<Account> insertedAccounts = [SELECT Name, Description
FROM Account
WHERE Id IN : accounts];
// Assert that the Description fields contains the proper value now.
for(Account a : insertedAccounts){
System.assertEquals(
'This Account is probably left over from testing. It should probably be deleted.',
a.Description);
}
}
}
Hi,
Make sure that your list of class should not contain class name as 'test',
if any of your class name is test please rename the class name
thanks
now its working