-
Test Coverage for Pagereference method with if statement
I need your assistance to complete test coverage for the following code. How do I add the Pagereference method in my test class and cover the if condition, Thank you!
public Pagereference newPage() {
Id classRecordTypeId = Schema.SObjectType.class__c.getRecordTypeInfosByName().get('Staff').getRecordTypeId();
String url = 'https://ourcommunity.force.com/staffportal/List?id=' + classId;
if(classType == classRecordTypeId) {
url += '&type=Staff';
}
return new PageReference(url);
}
Log In to reply.
Popular Salesforce Blogs
The Perks of Getting a Salesforce Certification
Certifications are the way to go these days if one is looking to upskill and grow their career. Degrees are great, but a course certification…
Debug and Deployment Tools in Salesforce
Development Tools In Salesforce 1. Developer Edition Environment You may start designing and testing your software-as-a-service application right now in this online environment. Designed for…
Detailed Guide to Implement Salesforce Multi-Factor Authentication (MFA)
Plan To Implement MFA Configuring Permission Set in Salesforce Login in to your Salesforce account On the setup page, search “Permission Set” Click the “New”…
Popular Salesforce Videos
Salesforce Billing - Digital Wallets and Alternative Payment Methods
THE GOAL: In this video, you will learn how to use Alternative Payment Methods and Digital Wallets with Salesforce Billing. BEFORE YOU BEGIN, KNOW THE…
What is Headless Commerce? | Salesforce Commerce Cloud
Brands need to keep up with this change and require a certain level of agility and nimbleness. This is where Headless Commerce is a game…
How to get a job in Salesforce industry or ecosystem? (For freshers) | 7 Step Guide
The most common question that is asked: How do I get a job? I have learned Salesforce and I know how to create applications on…
Popular Salesforce Infographics
Customer Service: The Forgotten Marketing Channel
The key to good customer service is building good relationships with your customers. Thanking the customer and promoting a positive, helpful and friendly environment will…
Why You Should Know About Order to Cash Process - Step by Step | Salesforce Guide
The order-to-cash (O2C) process is a defining part of a company’s success, and it also plays a big role in driving an organization’s relationship with…
How Salesforce Admins Manage their Data?
No matter how long you’ve been working within Salesforce, it’s important to regularly evaluate the data management systems you have in place and review the…