-
How can I cover the code coverage for multiple conditions in IF statement in Salesforce?
Below is the code for class:
public class ControllerHelper
{
public static boolean validate (Case obj)
{
if((obj.field1 = 'Yes' || obj.field2 = 'Yes') && checkNullValue(obj.field3))
||
((obj.field4 = 'Yes' || obj.field5 = 'Yes') && checkNullValue(obj.field6))
)
return true;
else
{
return false;
}
}public static boolean checkNullValue(String value)
{
if(value==null || value.trim().length()==0)
{
return true;
}
return false;
}
}
Log In to reply.
Popular Salesforce Blogs
Mission Three: Multi-Dimensional Quoting (MDQ) and Quote Line Groups | Salesforce CPQ
Video 3: Managing Subscription Products with Salesforce CPQ Mission Three: Multi-Dimensional Quoting (MDQ) & Quote Line Groups Hey, Salesforce enthusiasts! As promised, we are back…
Things to Know About Salesforce Dreamforce 2019
Summer is over, and that can only mean one thing, Dreamforce is near. Dreamforce is the biggest annual conference held by Salesforce. There are so…
Leverage the Power of Salesforce Marketing Cloud Account Engagement for Inbound Marketing
Inbound marketing is an effective strategy for producing excellent content that meets the demands of your target markets and fosters enduring relationships with customers. Because…
Popular Salesforce Videos
Salesforce For Non Programmers | Salesforce For Non Technicals
You can learn Salesforce without any programming language. You can plan Salesforce Administrator Certification which requires no coding skills. Watch this video to learn how.
Salesforce Exam Dumps - Are They Worth It?
In this video, Brad discusses the unethical, yet common, practice of using Exam Dumps to pass a certification exam. These dumps are not only immoral,…
What is Lightning Web Components (LWC) in Salesforce?
LWC is a collection of modern framework which has lightweight features and we can create a reusable code. Watch this video and let us know…