You need to sign in to do that
Don't have an account?
Bylithium
Test Class for Trigger
Hi..I have finished writting a trigger I need to write a test class
do i need to create a new apex class and write the test class or can i just write the test class in the trigger itself starting my code with @isTest
It was giving me an error when I am trying to start the test class where the trigger ended.
Hi bylithium,
you need to create a new Apex TestClass to test the trigger;
@isTest is only available on Apex Class, not in trigger
All Answers
Hi bylithium,
you need to create a new Apex TestClass to test the trigger;
@isTest is only available on Apex Class, not in trigger
Creating a new Apex class for testing is better. Refer Apex guide for more details.
This blog post should help explain how to write bulk safe triggers and test them properly:
Writing Bulk Triggers for Salesforce.com
Jeff Douglas
Appirio, Inc.
http://blog.jeffdouglas.com
Author: The Salesforce Handbook
Thanks Guys !!