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
Krishna Sahu 1Krishna Sahu 1 

Need help to write test class on that

public inherited sharing class ProcedureCode
{
    @AuraEnabled
    public String procedureCodeId;
    @AuraEnabled
    public String procedureMasterCode;
    @AuraEnabled
    public String cptCode;
    @AuraEnabled
    public String description;
    @AuraEnabled
    public Decimal units;

    public ProcedureCode(String procedureCodeId, String procedureMasterCode, String cptCode, String description, Decimal units)
    {
        this.procedureCodeId = this.procedureCodeId;
        this.procedureMasterCode = procedureMasterCode;
        this.cptCode = cptCode;
        this.description = description;
        this.units = units;
    }
}
Best Answer chosen by Krishna Sahu 1
CharuDuttCharuDutt
Hii Krishna Sahu
Try Below Test Class Coverage 100%
@isTest
public class ProcedureCodeTest {
 @isTest
    public Static void UnitTest(){
        
        ProcedureCode opc = new ProcedureCode('012345','012345','0001','test description',00.10);
      
    }
}
Please Mark It As Best Asnwer If It Helps
Thank You!

All Answers

SwethaSwetha (Salesforce Developers) 
HI Krishna,
The below articles give an idea of how to get started with test classes. You will need to customize based on your requirement
 
https://salesforce.stackexchange.com/questions/244794/how-do-i-increase-my-code-coverage-or-why-cant-i-cover-these-lines
 
https://salesforce.stackexchange.com/questions/244788/how-do-i-write-an-apex-unit-test
 
Thanks
CharuDuttCharuDutt
Hii Krishna Sahu
Try Below Test Class Coverage 100%
@isTest
public class ProcedureCodeTest {
 @isTest
    public Static void UnitTest(){
        
        ProcedureCode opc = new ProcedureCode('012345','012345','0001','test description',00.10);
      
    }
}
Please Mark It As Best Asnwer If It Helps
Thank You!
This was selected as the best answer
Krishna Sahu 1Krishna Sahu 1
Hello Charu
Thank you so much