You need to sign in to do that
Don't have an account?
Jerome Almejas 33
How to write test class for the code below?
Can you please help me create test class for this code below?
public class CSS_NavigateReturnsPortal {
@AuraEnabled
public static String getURL(Id orderID) {
Order tempOrder = [SELECT OrderNumber, CSS_Contact__r.Email FROM Order WHERE Id = :orderId];
String strURL = '{"order_number":"' + tempOrder.OrderNumber + '","email":"' + tempOrder.CSS_Contact__r.Email + '"}';
Blob tempBlob = Blob.valueOf(strURL);
return EncodingUtil.base64Encode(tempBlob);
}
}
public class CSS_NavigateReturnsPortal {
@AuraEnabled
public static String getURL(Id orderID) {
Order tempOrder = [SELECT OrderNumber, CSS_Contact__r.Email FROM Order WHERE Id = :orderId];
String strURL = '{"order_number":"' + tempOrder.OrderNumber + '","email":"' + tempOrder.CSS_Contact__r.Email + '"}';
Blob tempBlob = Blob.valueOf(strURL);
return EncodingUtil.base64Encode(tempBlob);
}
}
You can write the test class as below. This will cover 100% of the code.
If this solution helps, Please mark it as best answer.
Thanks,
All Answers
You can write the test class as below. This will cover 100% of the code.
If this solution helps, Please mark it as best answer.
Thanks,
Try Below Test Class 100% Code Coverage Please Mark It As Best Answer If It Helps
Thank You!