You need to sign in to do that
Don't have an account?
Michele Toscano
Test Code Coverage for listAcc
if(listacc != null && !listacc.isEmpty()) - if this never evaluates to true- then how can I increase my code coverage of the block of code which follows- in order to increase my test class code coverage?
Account acc = listacc[0];
samObj.Planning_Account__c= acc.ParentId;
samObj.Customer_Group__c= acc.Customer_Group_Description__c;
samObj.CABOT_Segment__c= acc.CABOT_Segment__c;
samObj.Account_Manager__c= acc.OwnerId;
samObj.Technical_Manager__c= acc.Technical_Service_Manager__c;
samObj.Ship_To_Address_Line_1__c= acc.Address_Line_1__c;
samObj.Ship_To_Address_Line_2__c= acc.Address_Line_2__c;
samObj.Ship_To_Address_Line_3__c= acc.Address_Line_3__c;
samObj.Ship_To_Address_Line_4__c= acc.Address_Line_4__c;
samObj.Account_Region__c= acc.Sub_Region__c;
samObj.Ship_To_Country__c= acc.Country__c;
samObj.Ship_To_State__c= acc.State__c;
samObj.Ship_To_City__c= acc.City__c;
samObj.Ship_To_Postal_Code__c= acc.Postal_Code__c;
Account acc = listacc[0];
samObj.Planning_Account__c= acc.ParentId;
samObj.Customer_Group__c= acc.Customer_Group_Description__c;
samObj.CABOT_Segment__c= acc.CABOT_Segment__c;
samObj.Account_Manager__c= acc.OwnerId;
samObj.Technical_Manager__c= acc.Technical_Service_Manager__c;
samObj.Ship_To_Address_Line_1__c= acc.Address_Line_1__c;
samObj.Ship_To_Address_Line_2__c= acc.Address_Line_2__c;
samObj.Ship_To_Address_Line_3__c= acc.Address_Line_3__c;
samObj.Ship_To_Address_Line_4__c= acc.Address_Line_4__c;
samObj.Account_Region__c= acc.Sub_Region__c;
samObj.Ship_To_Country__c= acc.Country__c;
samObj.Ship_To_State__c= acc.State__c;
samObj.Ship_To_City__c= acc.City__c;
samObj.Ship_To_Postal_Code__c= acc.Postal_Code__c;
All Answers
NOTE:- you need to pull some value in your listacc list. If you are using any SOQL then create some data according to your query.