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
CTU007CTU007 

do I need to write test code for some simple SOQL code

Hi, I save the following code to the production in Eclipse, no test code included as I dont know how to do it.

 

 

public class sortedmilestones { public Id opportunityID {get; set;} List<Milestones__c> milestones; public List<Milestones__c> getmilestones(){ if(milestones == null){ milestones = [select Id, Name, Milestone__c, Stage__c, Verifiable_Outcome__c, Achieved__c, Date_Achieved__c, Milestone_Notes__c from Milestones__c where Opportunity__c =:opportunityID order by Name]; } return milestones; } }

 

 It seems like it is working properly.

 

My question is, is test code requried for this? What is the down side if there is no test code?