The Below is the code for getting Multiselect picklist. Currently its returning null when i Run test class.
Class
public List<string> Category{
get; set;
}
public List < SelectOption > listcategory{
get; set;
}
Schema.DescribeFieldResult fieldResult = Master__c.Type__c.getDescribe();
List<Schema.picklistEntry> ple = fieldResult.getPicklistValues();
for(Schema.picklistEntry f:ple)
{
listcategory.add(new selectOption(f.getLabel(),f.getValue()));
}
Where as the the Master__c.Type__c contains the values like
Actives,Passives,Misc and others
My Complete Controller runs on this snippet if its covered then my class will cover 100%.
So some one can let me know how to Pass the Above values into the Category field.
Test Class
@isTest
public class Testgenerate5 {
static testMethod void testgenerate() {
CreateDataHelper h = new CreateDataHelper();
Product2 pr = h.CreateSingleproduct();
insert pr;
ProcurementAppSetup__c pba = h.createbilling();
insert pba;
Oper15 gbom = new Oper15 ();
ApexPages.StandardController sc = new ApexPages.StandardController(boo);
Oper15 ac = new Oper15 (sc);
account a = h.CreateSingleAccount();
insert a;
Product2 p = h.CreateSingleproduct();
insert p;
Contact c = h.CreateSingleContact(a.id);
insert c;
MasterItem__c Mi = h.createMi();
insert Mi;
string indexParam = ApexPages.currentPage().getParameters().put('rowIndex', '0');
Bom__c bb = h.createBom(p.id, pb.id);
insert bb;
Boolean disppop = false;
gbom.setmallSelected();
}
}
ple
has any values.