You need to sign in to do that
Don't have an account?
Runi
Aura
Hi All,
How to write test class for below code.
thanks
Swathi
public class Radius {
@AuraEnabled
public static Map<String, Object> getUserDetails1() {
Map<String, Object> returnMap = new Map<String, Object>();
String userId = UserInfo.getUserId();
User userRecord = [SELECT Id, ContactId, AccountId FROM User WHERE Id =: userId];
Account personAccRecord = [SELECT Name, Phone FROM Account WHERE Id =: userRecord.AccountId];
returnMap.put('personAccRecord', personAccRecord);
return returnMap;
}
}
How to write test class for below code.
thanks
Swathi
public class Radius {
@AuraEnabled
public static Map<String, Object> getUserDetails1() {
Map<String, Object> returnMap = new Map<String, Object>();
String userId = UserInfo.getUserId();
User userRecord = [SELECT Id, ContactId, AccountId FROM User WHERE Id =: userId];
Account personAccRecord = [SELECT Name, Phone FROM Account WHERE Id =: userRecord.AccountId];
returnMap.put('personAccRecord', personAccRecord);
return returnMap;
}
}
Can you try the below test class for the apex class.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks