You need to sign in to do that
Don't have an account?
TestsalesforceAccount
test class requires
can you please anyone help me how to write test class for below code.
public class UpdateOpptyController {
@AuraEnabled
public static void updateOpportunity(Opportunity oppty){
UPDATE oppty;
}
@AuraEnabled
public static Opportunity fetchOpportunityDetails(Id oppId) {
List<Opportunity> lstOfStd = new List<Opportunity>();
system.debug('=='+oppId);
if(oppId != null) {
lstOfStd = [SELECT Id, Name,checkbox1__c,Checkbox2__c,Checkbox3__c FROM Opportunity WHERE Id = :oppId];
system.debug('=='+lstOfStd);
}
if(!lstOfStd.isEmpty()){
return lstOfStd.get(0);
}
return null;
}
}
public class UpdateOpptyController {
@AuraEnabled
public static void updateOpportunity(Opportunity oppty){
UPDATE oppty;
}
@AuraEnabled
public static Opportunity fetchOpportunityDetails(Id oppId) {
List<Opportunity> lstOfStd = new List<Opportunity>();
system.debug('=='+oppId);
if(oppId != null) {
lstOfStd = [SELECT Id, Name,checkbox1__c,Checkbox2__c,Checkbox3__c FROM Opportunity WHERE Id = :oppId];
system.debug('=='+lstOfStd);
}
if(!lstOfStd.isEmpty()){
return lstOfStd.get(0);
}
return null;
}
}
Check below code
regards
All Answers
Check below code
regards
Sampath Suranji,
Thank you so much. its covered 100%.
Regards,
Nagaraj