You need to sign in to do that
Don't have an account?
Valentin F.
Testing getter setter
I'm not able to test getters/setters neither understand how it works to test them.
public with sharing class ALSearchController { public class Location{ @AuraEnabled public String icon{get;set;} @AuraEnabled public String title{get;set;} @AuraEnabled public GeoLocation location{get;set;} @AuraEnabled public String description{get;set;} @AuraEnabled public String id{get;set;} @AuraEnabled public String type{get;set;} @AuraEnabled public String status{get;set;} } }I tried
Location loc = new Location(); String icon = loc.icon; icon = 'test'; System.assertEquals(icon, 'test');but I got an error for the = sign : Unexpected token '=' even if the Location object belong to ALSearchController.
Please try the below code and let me know if this works for you. If still need modifications do let me know.
ApexClass:
TestClass:
Please go through the below link for inner class:
https://www.jitendrazaa.com/blog/java/nested-class-and-its-necessity-with-example/
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
All Answers
Please try the below code and let me know if this works for you. If still need modifications do let me know.
ApexClass:
TestClass:
Please go through the below link for inner class:
https://www.jitendrazaa.com/blog/java/nested-class-and-its-necessity-with-example/
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
Thank you for answering by the way.
Thank you for your answer and your link, this is working !