function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Phuc Nguyen 18Phuc Nguyen 18 

Test coverage for line break

Hello all,
Most of my Class has coverage except for the following.
This is part of a Class that parses a Multiselect and puts each value on its own line.  
I know that actComments != null but I do not know how to get the following to have coverage.
Any help is appreciated.
actComments = actComments.removeEnd('\n'); // Removing the last line breaker
    tc.Comment__c = actComments;

Hello. I think the reason this line is not covered is because of a conditional that preceeds it. If a line is not covered by a test class, it's not because something is wrong with the line itself, but because it is never executed at runtime. Would you please provide the entire class and test class?

SFDC Apex DevSFDC Apex Dev
Hi Phuc,

Can you provide the entire class and test class?