Please use below test class to check bulkify Opportunity trigger code:-
@isTest
public class oppertunity_Test
{
public static testmethod void testoppertunity()
{
List<Account> listacc = new List<Account>();
Account acc1 = new Account(Name = 'TestAccountName');
Insert acc1;
List<Opportunity> listOpportunity = new list<Opportunity >();
for(Integer i = 0 ; i<=100 ;i++)
{
Opportunity opp1 = new Opportunity() ;
opp1.Name ='Test'+i;
opp1.accountid = acc1.id;
opp1.StageName = 'Closed Won';
opp1.CloseDate=Date.Today();
listOpportunity.add(opp1);
}
Test.startTest();
insert listOpportunity;
Test.stopTest();
}
}
Some Link for you http://wiki.developerforce.com/page/An_Introduction_to_Apex_Code_Test_Methods http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/ http://salesforce.stackexchange.com/questions/27676/test-class-not-covered-when-bulk-data-is-passed
Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help
All Answers
Please use below test class to check bulkify Opportunity trigger code:-
Some Link for you
http://wiki.developerforce.com/page/An_Introduction_to_Apex_Code_Test_Methods
http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/
http://salesforce.stackexchange.com/questions/27676/test-class-not-covered-when-bulk-data-is-passed
Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help