I got the below test class,
@isTest
public with sharing class CategoryHelperTest {
private static boolean testDataCreated = false;
private static Scheme__c ss;
private static Scheme__c ss2;
private static Scheme__c ss3;
private static Scheme__c ss4;
private static Scheme__c ss5;
private static Scheme__c ss6;
public static void tester(){
ss = new Scheme__c(Name = 'TestScheme', Description__c = 'TestScheme');
insert ss;
ss2 = new Scheme__c(Name = 'TestScheme', Description__c = 'TestgScheme2');
insert ss2;
ss3 = new Scheme__c(Name = 'TestScheme', Description__c = 'TestScheme3');
insert ss3;
ss4 = new Scheme__c(Name = 'TestScheme', Description__c = 'TestScheme4');
insert ss4;
ss5 = new Scheme__c(Name = 'TestScheme', Description__c = 'TestScheme5');
insert ss5;
ss6 = new Scheme__c(Name = 'TestScheme', Description__c = 'TestScheme6');
insert ss6;
I want to use a list for schemes, instead inserting data one by one. How can I get this done using a List ?